From 078a3661eff97ed7f8c28feab937de20364e8f11 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 8 Jun 2024 01:47:20 +0300 Subject: [PATCH 01/35] libd3d declarations --- libsrc/lgd3d/blit.c | 46 - libsrc/lgd3d/clip.c | 221 ----- libsrc/lgd3d/comshell.c | 77 -- libsrc/lgd3d/d3dmacs.h | 169 ---- libsrc/lgd3d/d3dpoint.h | 24 - libsrc/lgd3d/d3dtest.c | 265 ------ libsrc/lgd3d/d3dtest.h | 5 - libsrc/lgd3d/d6Base.cpp | 7 + libsrc/lgd3d/d6Enum.cpp | 13 + libsrc/lgd3d/d6Frame.cpp | 65 ++ libsrc/lgd3d/d6Intfc.cpp | 124 +++ libsrc/lgd3d/d6Over.cpp | 105 +++ libsrc/lgd3d/d6Over.h | 19 + libsrc/lgd3d/d6Prim.h | 127 +++ libsrc/lgd3d/d6Prim_s.cpp | 59 ++ libsrc/lgd3d/d6Render.cpp | 53 ++ libsrc/lgd3d/d6Render.h | 39 + libsrc/lgd3d/d6States.h | 177 ++++ libsrc/lgd3d/d6sts_s.cpp | 72 +- libsrc/lgd3d/enum.cpp | 259 ------ libsrc/lgd3d/lgSS2P.h | 14 - libsrc/lgd3d/lgSurf.cpp | 3 + libsrc/lgd3d/lgSurf_i.h | 74 ++ libsrc/lgd3d/lgd3d.cpp | 18 - libsrc/lgd3d/lgd3d.h | 438 ---------- libsrc/lgd3d/lgd3d.vcxproj | 45 +- libsrc/lgd3d/lgd3d_g.cpp | 1 + libsrc/lgd3d/render.c | 1612 ------------------------------------ libsrc/lgd3d/setup.c | 449 ---------- libsrc/lgd3d/setup.h | 41 - libsrc/lgd3d/tdrv.h | 44 - libsrc/lgd3d/texmgr.cpp | 35 + libsrc/lgd3d/texture.c | 1312 ----------------------------- libsrc/lgd3d/texture.h | 16 - libsrc/lgd3d/tmgr.c | 771 ----------------- libsrc/lgd3d/tmgr.h | 50 -- libsrc/lgd3d/tmgrold.c | 548 ------------ 37 files changed, 991 insertions(+), 6406 deletions(-) delete mode 100644 libsrc/lgd3d/blit.c delete mode 100644 libsrc/lgd3d/clip.c delete mode 100644 libsrc/lgd3d/comshell.c delete mode 100644 libsrc/lgd3d/d3dmacs.h delete mode 100644 libsrc/lgd3d/d3dpoint.h delete mode 100644 libsrc/lgd3d/d3dtest.c delete mode 100644 libsrc/lgd3d/d3dtest.h create mode 100644 libsrc/lgd3d/d6Base.cpp create mode 100644 libsrc/lgd3d/d6Enum.cpp create mode 100644 libsrc/lgd3d/d6Frame.cpp create mode 100644 libsrc/lgd3d/d6Intfc.cpp create mode 100644 libsrc/lgd3d/d6Over.cpp create mode 100644 libsrc/lgd3d/d6Over.h create mode 100644 libsrc/lgd3d/d6Prim.h create mode 100644 libsrc/lgd3d/d6Prim_s.cpp create mode 100644 libsrc/lgd3d/d6Render.cpp create mode 100644 libsrc/lgd3d/d6Render.h create mode 100644 libsrc/lgd3d/d6States.h delete mode 100644 libsrc/lgd3d/enum.cpp delete mode 100644 libsrc/lgd3d/lgSS2P.h create mode 100644 libsrc/lgd3d/lgSurf.cpp create mode 100644 libsrc/lgd3d/lgSurf_i.h delete mode 100644 libsrc/lgd3d/lgd3d.cpp delete mode 100644 libsrc/lgd3d/lgd3d.h create mode 100644 libsrc/lgd3d/lgd3d_g.cpp delete mode 100644 libsrc/lgd3d/render.c delete mode 100644 libsrc/lgd3d/setup.c delete mode 100644 libsrc/lgd3d/setup.h delete mode 100644 libsrc/lgd3d/tdrv.h create mode 100644 libsrc/lgd3d/texmgr.cpp delete mode 100644 libsrc/lgd3d/texture.c delete mode 100644 libsrc/lgd3d/texture.h delete mode 100644 libsrc/lgd3d/tmgr.c delete mode 100644 libsrc/lgd3d/tmgr.h delete mode 100644 libsrc/lgd3d/tmgrold.c diff --git a/libsrc/lgd3d/blit.c b/libsrc/lgd3d/blit.c deleted file mode 100644 index 6a9c04b..0000000 --- a/libsrc/lgd3d/blit.c +++ /dev/null @@ -1,46 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/blit.c 1.1 1997/06/02 16:41:01 KEVIN Exp $ - -#include -#include - -#include -#include - -#include - -static void lock_surface(grs_bitmap *bm, LPDIRECTDRAWSURFACE ddsurf) -{ - int type; - - DDSURFACEDESC sd; - sd.dwSize = sizeof(sd); - IDirectDrawSurface_Lock(ddsurf, NULL, &sd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); - - switch (sd.ddpfPixelFormat.dwRGBBitCount) { - case 8: - type = BMT_FLAT8; - break; - case 15: - case 16: - type = BMT_FLAT16; - break; - default: - CriticalMsg("Unsupported pixel format"); - } - - gr_init_bitmap(bm, (uchar *)sd.lpSurface, type, 0, sd.dwWidth, sd.dwHeight); -} - -static void unlock_surface(grs_bitmap *bm, LPDIRECTDRAWSURFACE ddsurf) -{ - IDirectDrawSurface_Unlock(ddsurf, (LPVOID) bm->bits); -} - -void lgd3d_blit(void) -{ - grs_bitmap bm; - - lock_surface(&bm, lpddDevice); - gr_bitmap(&bm, 0, 0); - unlock_surface(&bm, lpddDevice); -} diff --git a/libsrc/lgd3d/clip.c b/libsrc/lgd3d/clip.c deleted file mode 100644 index b565dbc..0000000 --- a/libsrc/lgd3d/clip.c +++ /dev/null @@ -1,221 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/clip.c 1.3 1997/12/04 13:02:45 KEVIN Exp $ - -#include -#include -#include -#include - -#include - -static lgd3ds_point *tmp; -static float (*intersect)(lgd3ds_point *v0, lgd3ds_point *v1); -static float clip_val; - -extern float lgd3d_clip[4]; - -#define left lgd3d_clip[0] -#define right lgd3d_clip[1] -#define top lgd3d_clip[2] -#define bot lgd3d_clip[3] - -static void code_xy(lgd3ds_point *v) -{ - v->flags = 0; - if (v->sx < left) - v->flags|=CLIP_LEFT; - else if (v->sx > right) - v->flags|=CLIP_RIGHT; - if (v->sy < top) - v->flags|=CLIP_TOP; - else if (v->sy > bot) - v->flags|=CLIP_BOT; -} - -static void code_y(lgd3ds_point *v) -{ - v->flags = 0; - if (v->sy < top) - v->flags|=CLIP_TOP; - else if (v->sy > bot) - v->flags|=CLIP_BOT; -} - -static void clip_func(lgd3ds_point *v0, lgd3ds_point *v1, float r) -{ - float da = v1->a - v0->a; - float dr = v1->r - v0->r; - float dg = v1->g - v0->g; - float db = v1->b - v0->b; - float du = v1->u - v0->u; - float dv = v1->v - v0->v; - - tmp->a = v0->a + da*r; - tmp->r = v0->r + dr*r; - tmp->g = v0->g + dg*r; - tmp->b = v0->b + db*r; - tmp->u = v0->u + du*r; - tmp->v = v0->v + dv*r; - tmp->rhw = v0->rhw; - tmp->sz = v0->sz; -} - -static float x_intersect(lgd3ds_point *v0, lgd3ds_point *v1) -{ - float dy,r; - tmp->sx = clip_val; - r = clip_val - v0->sx; - r /= v1->sx - v0->sx; - dy = v1->sy - v0->sy; - tmp->sy = v0->sy + r*dy; - tmp->flags = 0; - code_y(tmp); - return r; -} - -static float y_intersect(lgd3ds_point *v0, lgd3ds_point *v1) -{ - float dx,r; - tmp->sy = clip_val; - r = clip_val - v0->sy; - r /= v1->sy - v0->sy; - dx = v1->sx - v0->sx; - tmp->sx = v0->sx + r*dx; - tmp->flags = 0; - return r; -} - -static uchar get_codes(lgd3ds_point **a, int n) -{ - uchar ccr, cc; - lgd3ds_point **last; - - last = a + n; - ccr = CLIP_LEFT|CLIP_RIGHT|CLIP_TOP|CLIP_BOT; - cc = 0; - for (; aflags; - ccr &= (*a)->flags; - } - if (ccr!=0) - return CLIP_ALL; // trivial reject - return (cc); -} - -static int do_plane(lgd3ds_point **src, lgd3ds_point **dest, int n, uchar code) -{ - uchar c0; - int m=0; - lgd3ds_point **start, **end, **last; - - start = last = src+n-1; - end = src; - c0=((*start)->flags&code); - do { - uchar c1=((*end)->flags&code); - - // output all the points that are in! - if (c0==0) { - *dest = *start; - dest++, m++; - } - // if one's in and one's out, compute the intersection! - if (c1 ^ c0) { - lgd3ds_point *v0, *v1; - float r; - - v0 = *start; - v1 = *end; - // sort vertices to avoid cracking. - if ((v0->sx < v1->sx)|| - (v0->sx==v1->sx)&&(v0->sysy)) { - lgd3ds_point *swap = v0; - v0 = v1; - v1 = swap; - } - r = intersect(v0, v1); - if (clip_func != NULL) - clip_func(v0, v1, r); - *dest = tmp; - dest++, m++, tmp++; - } - start = end, c0=c1; - end++; - } while (start != last); - return m; -} - -#define MAX_TEMP_POINTS 8 // (2 per clipping plane) - -int lgd3d_clip_poly(int n, lgd3ds_point **vpl, lgd3ds_point ***pcvpl) -{ - lgd3ds_point **src, **dest, **next; /* lists of vertex pointers */ - int max_verts, i; /* max number of output vertexes */ - uchar cc; /* aggregate clip codes for entire poly */ - - for (i=0; i -#include -#include -#include -#include -#include -#include - -#include - -tResult LGAPI AppCreateObjects (int argc, const char *argv[]) -{ - // Parse commmandline arguments - GUID *ddraw_guid = d3dtestParseArgs(argc, argv); - - // Create the application object - GenericApplicationCreate(argc, argv, "d3dtest", NULL); - - // Create the display device - DisplayDeviceCreate2(kDispFullScreen, kDispAttempt3D|kDispAttemptFlippable); - - if (ddraw_guid != NULL) { - IDisplayDevice *pDD = AppGetObj(IDisplayDevice); - pDD->lpVtbl->SetKind2(pDD, kDispFullScreen, kDispAttempt3D|kDispAttemptFlippable, ddraw_guid); - } - - // Create the game shell - GameShellCreate(kGameShellDefault & ~kLockFrame); - - // Init the input library - InputCreate(); - - return 0; // Success -} - -tResult LGAPI AppInit () -{ - d3dtestInit(); - - return 0; // Success -} - -tResult LGAPI AppExit () -{ - d3dtestExit(); - - return 0; // Success -} - -#include -int LGAPI AppMain (int argc, const char *argv[]) -{ - IGameShell * pGameShell = AppGetObj (IGameShell); - - do { - IGameShell_PumpEvents(pGameShell, kPumpAll); - } while (d3dtestLoop()); - - return 0; // Success -} - -// goofy abstraction needed because input lib doesn't work under dos -// and getch() doesn't work under windows, unless, of course, -// we're a console app, but we're not. -bool AppGetKey(char *c) -{ - ushort key; - - if ((!kb_get_cooked(&key))|| - (!(key&KB_FLAG_DOWN))) - return FALSE; - - *c = kb2ascii(key); - return TRUE; -} diff --git a/libsrc/lgd3d/d3dmacs.h b/libsrc/lgd3d/d3dmacs.h deleted file mode 100644 index 9fe01d2..0000000 --- a/libsrc/lgd3d/d3dmacs.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 1995, 1996 Microsoft Corporation. All Rights Reserved. - * - * File: d3dmacs.h - * - * Useful macros for generating execute buffers. Consult the D3D sample - * code for examples of their usage. - * - * Use OP_NOP to QWORD align triangle and line instructions. - */ - -#ifndef __D3DMACS_H__ -#define __D3DMACS_H__ - -#undef RELEASE - -#ifndef __cplusplus -#define MAKE_MATRIX(lpDev, handle, data) \ -{ if (lpDev->lpVtbl->CreateMatrix(lpDev, &handle) != D3D_OK) \ - return FALSE; \ - if (lpDev->lpVtbl->SetMatrix(lpDev, handle, &data) != D3D_OK) \ - return FALSE; \ -} -#define RELEASE(x) {if (x != NULL) {x->lpVtbl->Release(x); x = NULL;}} -#endif - -#ifdef __cplusplus -#define MAKE_MATRIX(lpDev, handle, data) \ -{ if (lpDev->CreateMatrix(&handle) != D3D_OK) \ - return FALSE; \ - if (lpDev->SetMatrix(handle, &data) != D3D_OK) \ - return FALSE; \ -} -#define RELEASE(x) {if (x != NULL) {x->Release(); x = NULL;}} -#endif - -#define PUTD3DINSTRUCTION(op, sz, cnt, ptr) \ -( ((LPD3DINSTRUCTION) ptr)->bOpcode = op, \ - ((LPD3DINSTRUCTION) ptr)->bSize = sz, \ - ((LPD3DINSTRUCTION) ptr)->wCount = cnt, \ - ptr = (void *)(((LPD3DINSTRUCTION) ptr) + 1) \ -) - -#define VERTEX_DATA(loc, cnt, ptr) \ -( (((ptr) != (loc))? memcpy((ptr), (loc), sizeof(D3DVERTEX) * (cnt)) : 0), \ - ptr = (void *)(((LPD3DVERTEX) (ptr)) + (cnt)) \ -) - -// OP_MATRIX_MULTIPLY size: 4 (sizeof D3DINSTRUCTION) -#define OP_MATRIX_MULTIPLY(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_MATRIXMULTIPLY, sizeof(D3DMATRIXMULTIPLY), cnt, ptr) - -// MATRIX_MULTIPLY_DATA size: 12 (sizeof MATRIXMULTIPLY) -#define MATRIX_MULTIPLY_DATA(src1, src2, dest, ptr) \ -( ((LPD3DMATRIXMULTIPLY) ptr)->hSrcMatrix1 = src1, \ - ((LPD3DMATRIXMULTIPLY) ptr)->hSrcMatrix2 = src2, \ - ((LPD3DMATRIXMULTIPLY) ptr)->hDestMatrix = dest, \ - ptr = (void *)(((LPD3DMATRIXMULTIPLY) ptr) + 1) \ -) - -// OP_STATE_LIGHT size: 4 (sizeof D3DINSTRUCTION) -#define OP_STATE_LIGHT(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_STATELIGHT, sizeof(D3DSTATE), cnt, ptr) - -// OP_STATE_TRANSFORM size: 4 (sizeof D3DINSTRUCTION) -#define OP_STATE_TRANSFORM(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_STATETRANSFORM, sizeof(D3DSTATE), cnt, ptr) - -// OP_STATE_RENDER size: 4 (sizeof D3DINSTRUCTION) -#define OP_STATE_RENDER(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_STATERENDER, sizeof(D3DSTATE), cnt, ptr) - -// STATE_DATA size: 8 (sizeof D3DSTATE) -#define STATE_DATA(type, arg, ptr) \ -( ((LPD3DSTATE) ptr)->drstRenderStateType = (D3DRENDERSTATETYPE)type, \ - ((LPD3DSTATE) ptr)->dwArg[0] = arg, \ - ptr = (void *)(((LPD3DSTATE) ptr) + 1) \ -) - -// OP_PROCESS_VERTICES size: 4 (sizeof D3DINSTRUCTION) -#define OP_PROCESS_VERTICES(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_PROCESSVERTICES, sizeof(D3DPROCESSVERTICES), cnt, ptr) - -// PROCESSVERTICES_DATA size: 16 (sizeof D3DPROCESSVERTICES) -#define PROCESSVERTICES_DATA(flgs, strt, cnt, ptr) \ -( ((LPD3DPROCESSVERTICES) ptr)->dwFlags = flgs, \ - ((LPD3DPROCESSVERTICES) ptr)->wStart = strt, \ - ((LPD3DPROCESSVERTICES) ptr)->wDest = strt, \ - ((LPD3DPROCESSVERTICES) ptr)->dwCount = cnt, \ - ((LPD3DPROCESSVERTICES) ptr)->dwReserved = 0, \ - ptr = (void *)(((LPD3DPROCESSVERTICES) ptr) + 1) \ -) - -// OP_TRIANGLE_LIST size: 4 (sizeof D3DINSTRUCTION) -#define OP_TRIANGLE_LIST(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_TRIANGLE, sizeof(D3DTRIANGLE), cnt, ptr) - -#define TRIANGLE_LIST_DATA(loc, count, ptr) \ -( ((ptr) != (loc))? memcpy((ptr), (loc), sizeof(D3DTRIANGLE) * (count)) : 0, \ - ptr = (void *)(((LPD3DTRIANGLE) (ptr)) + (count)) \ -) - -// OP_TRIANGLEEX_LIST size: 4 (sizeof D3DINSTRUCTION) -#define OP_TRIANGLEEX_LIST(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_TRIANGLEEX, sizeof(D3DTRIANGLEEX), cnt, ptr) - -#define TRIANGLEEX_LIST_DATA(loc, count, ptr) \ -( ((ptr) != (loc))? memcpy((ptr), (loc), sizeof(D3DTRIANGLEEX) * (count)) : 0, \ - ptr = (void *)(((LPD3DTRIANGLEEX) (ptr)) + (count)) \ -) - -// OP_LINE_LIST size: 4 (sizeof D3DINSTRUCTION) -#define OP_LINE_LIST(cnt, ptr) \ - PUTD3DINSTRUCTION(D3DOP_LINE, sizeof(D3DLINE), cnt, ptr) - -#define LINE_LIST_DATA(loc, count, ptr) \ -( ((ptr) != (loc))? memcpy((ptr), (loc), sizeof(D3DLINE) * (count)) : 0, \ - ptr = (void *)(((LPD3DLINE) (ptr)) + (count)) \ -) - -// OP_POINT_LIST size: 8 (sizeof D3DINSTRUCTION + sizeof D3DPOINT) -#define OP_POINT_LIST(first, cnt, ptr) \ -( PUTD3DINSTRUCTION(D3DOP_POINT, sizeof(D3DPOINT), 1, ptr), \ - ((LPD3DPOINT)(ptr))->wCount = cnt, \ - ((LPD3DPOINT)(ptr))->wFirst = first, \ - ptr = (void*)(((LPD3DPOINT)(ptr)) + 1) \ -) - -// OP_SPAN_LIST size: 8 (sizeof D3DINSTRUCTION + sizeof D3DSPAN) -#define OP_SPAN_LIST(first, cnt, ptr) \ -( PUTD3DINSTRUCTION(D3DOP_SPAN, sizeof(D3DSPAN), 1, ptr), \ - ((LPD3DSPAN)(ptr))->wCount = cnt, \ - ((LPD3DSPAN)(ptr))->wFirst = first, \ - ptr = (void*)(((LPD3DSPAN)(ptr)) + 1) \ -) - -// OP_BRANCH_FORWARD size: 18 (sizeof D3DINSTRUCTION + sizeof D3DBRANCH) -#define OP_BRANCH_FORWARD(tmask, tvalue, tnegate, toffset, ptr) \ -( PUTD3DINSTRUCTION(D3DOP_BRANCHFORWARD, sizeof(D3DBRANCH), 1, ptr), \ - ((LPD3DBRANCH) ptr)->dwMask = tmask, \ - ((LPD3DBRANCH) ptr)->dwValue = tvalue, \ - ((LPD3DBRANCH) ptr)->bNegate = tnegate, \ - ((LPD3DBRANCH) ptr)->dwOffset = toffset, \ - ptr = (void *)(((LPD3DBRANCH) (ptr)) + 1) \ -) - -// OP_SET_STATUS size: 20 (sizeof D3DINSTRUCTION + sizeof D3DSTATUS) -#define OP_SET_STATUS(flags, status, _x1, _y1, _x2, _y2, ptr) \ -( PUTD3DINSTRUCTION(D3DOP_SETSTATUS, sizeof(D3DSTATUS), 1, ptr), \ - ((LPD3DSTATUS)(ptr))->dwFlags = flags, \ - ((LPD3DSTATUS)(ptr))->dwStatus = status, \ - ((LPD3DSTATUS)(ptr))->drExtent.x1 = _x1, \ - ((LPD3DSTATUS)(ptr))->drExtent.y1 = _y1, \ - ((LPD3DSTATUS)(ptr))->drExtent.x2 = _x2, \ - ((LPD3DSTATUS)(ptr))->drExtent.y2 = _y2, \ - ptr = (void *)(((LPD3DSTATUS) (ptr)) + 1) \ -) - -// OP_NOP size: 4 -#define OP_NOP(ptr) \ - PUTD3DINSTRUCTION(D3DOP_TRIANGLE, sizeof(D3DTRIANGLE), 0, ptr) - -#define OP_EXIT(ptr) \ - PUTD3DINSTRUCTION(D3DOP_EXIT, 0, 0, ptr) - -#define QWORD_ALIGNED(ptr) \ - !(0x00000007L & (ULONG)(ptr)) - -#endif // __D3DMACS_H__ diff --git a/libsrc/lgd3d/d3dpoint.h b/libsrc/lgd3d/d3dpoint.h deleted file mode 100644 index 7c0207b..0000000 --- a/libsrc/lgd3d/d3dpoint.h +++ /dev/null @@ -1,24 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/d3dpoint.h 1.1 1997/10/09 15:31:05 KEVIN Exp $ - -#ifndef __D3DPOINT_H -#define __D3DPOINT_H - -typedef struct lgd3ds_point -{ - float sx; - float sy; - float sz; - float rhw; - uchar r; - uchar g; - uchar b; - uchar a; - uchar flags; - uchar sg; - uchar sb; - uchar sa; - float u; - float v; -} lgd3ds_point; - -#endif diff --git a/libsrc/lgd3d/d3dtest.c b/libsrc/lgd3d/d3dtest.c deleted file mode 100644 index fd07424..0000000 --- a/libsrc/lgd3d/d3dtest.c +++ /dev/null @@ -1,265 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/d3dtest.c 1.20 1998/05/11 10:56:28 KEVIN Exp $ -#include // for toupper -#include // for atexit - -#include -#include -#include -#include // gr testbed library headers -#include // g2 library headers -#include -#include -#include - -typedef struct { - short x,y; -} point; - -static double hazetest = 200.0; -static double ztest = 1.0; -static grs_canvas *zcanvas; -static fixang theta=0; - -static uchar bm_bits[256*256*2]; -static grs_bitmap bm={ - bm_bits, BMT_FLAT16, 0, BMF_POW2, 128, 16, 256, 7, 4 -}; -static uchar bm2_bits[64]; -static grs_bitmap bm2={ - bm2_bits, BMT_FLAT8, 0, BMF_POW2, 8, 8, 8, 3, 3 -}; -static point pos={40,40}; -static point size={256,256}; - -void break_here(void ) -{ -#ifdef WIN32 - extern void __stdcall DebugBreak(); - DebugBreak(); -#endif -}; - -static char input_char=0; -static int do_switch(void ) { - switch (input_char) { - case '2': size.y+=1; break; - case '8': size.y-=1; break; - case '4': size.x-=1; break; - case '6': size.x+=1; break; - case 'w': pos.y-=5; break; - case 'x': pos.y+=5; break; - case 'a': pos.x-=5; break; - case 'd': pos.x+=5; break; - case 'W': pos.y-=1; break; - case 'X': pos.y+=1; break; - case 'A': pos.x-=1; break; - case 'D': pos.x+=1; break; - case 'r': theta += 0x100; break; - case 'R': theta += 0x1000; break; - case 'v': theta -= 0x100; break; - case 'V': theta -= 0x1000; break; - case 'z': ztest += 0.1; mprintf("ztest: %g\n", ztest); break; - case 'Z': ztest -= 0.1; mprintf("ztest: %g\n", ztest); break; - case 'h': hazetest *= 1.5; mprintf("hazetest: %g\n", hazetest); break; - case 'H': hazetest /= 1.5; mprintf("hazetest: %g\n", hazetest); break; - case 'q': return 0; - } - return 1; -} - -static int auto_repeat=0; -extern bool AppGetKey(char *c); -static int get_input(void) -{ - if (AppGetKey(&input_char)) - return do_switch(); - - if (auto_repeat) - return do_switch(); - - return 1; -} - -static r3s_point pl[4]; -static r3s_point *ppl[4]; -static void make_ppl(void ) -{ - fix x0, y0; - fix dx, dy; - fix sint, cost; - - sint = fix_sin(theta); - cost = fix_cos(theta); - ppl[0]=pl, ppl[1]=pl+1, ppl[2]=pl+2; - x0 = fix_make(pos.x,0), y0 = fix_make(pos.y,0); - dx = fix_make(size.x,0xffff), dy = fix_make(size.y,0xffff); - pl[0].grp.sx = x0; pl[0].grp.sy = y0; - pl[1].grp.sx = x0 + fix_mul(dx, cost); - pl[1].grp.sy = y0 + fix_mul(dy, sint); - pl[2].grp.sx = x0 - fix_mul(dx, sint); - pl[2].grp.sy = y0 + fix_mul(dy, cost); - - pl[0].grp.u = pl[0].grp.v = -1.0; - pl[1].grp.u = 6.5, pl[1].grp.v=-1.0; - pl[2].grp.v = 1.5, pl[2].grp.u=-1.0; - pl[0].grp.i = 0.5, pl[1].grp.i = 0.1, pl[2].grp.i = 0.9; - pl[0].grp.w = pl[1].grp.w = pl[2].grp.w = 0.1; - - pl[3].grp.sx = x0 + ((fix_mul(dx, cost) - fix_mul(dx, sint))>>2); - pl[3].grp.sy = y0 + ((fix_mul(dy, cost) + fix_mul(dy, sint))>>2); - pl[3].grp.w = 0.05; - pl[3].p.z = 20.0; -} - -static void do_gfx(void ) -{ - static int frame=0; - int count; - IDisplayDevice *pDDev = AppGetObj(IDisplayDevice); - - tb_start_frame(); - gr_clear(0); - - lgd3d_set_offsets(0,0); - make_ppl(); - - count=pDDev->lpVtbl->BreakLock(pDDev); - - lgd3d_start_frame(frame++); - - lgd3d_set_fog_color(0,0,0); - lgd3d_set_fog_density(1.0/hazetest); - lgd3d_set_fog_enable(TRUE); - - ppl[0]->p.z = 5.0; - ppl[1]->p.z = 5.0; - ppl[2]->p.z = 5.0; - ppl[0]->grp.w = 0.2; - ppl[1]->grp.w = 0.2; - ppl[2]->grp.w = 0.2; - - g_tmgr->unload_texture(&bm); - -// lgd3d_set_zcompare(FALSE); - g_tmgr->set_texture(&bm); -// lgd3d_trifan(3, ppl); - - ppl[0]->p.z = 0.1; - ppl[1]->p.z = ztest; - ppl[2]->p.z = 0.1; - ppl[0]->grp.w = 10.0; - ppl[1]->grp.w = 1.0/ztest; - ppl[2]->grp.w = 10.0; - -// lgd3d_set_zcompare(TRUE); - g_tmgr->set_texture(&bm2); - lgd3d_trifan(3, ppl); - - lgd3d_hack_light(ppl[0],200.0); - - gr_set_fcolor(255); - lgd3d_draw_point(&pl[3]); - - g_tmgr->unload_texture(&bm2); - - lgd3d_end_frame(); -// g_tmgr->reload_texture(&bm); - - pDDev->lpVtbl->RestoreLock(pDDev, count); - -// gr_bitmap(&bm, pos.x, pos.y); -// g_tmgr->stats(); - tb_end_frame(); -} - -static lgd3ds_device_info *device_info; - -static void init(void ) -{ - int i; - ushort *bits = (ushort *)bm.bits; - - for (i=0; i>bm2.wlog)&1))?55:0; - for (i=0; iw, grd_cap->h); - - lgd3d_init(device_info); - atexit(lgd3d_shutdown); -#if 0 -{ - extern BOOL lgd3d_z_normal; - extern void lgd3d_set_zwrite(BOOL val); - extern void lgd3d_set_znearfar(double zn, double zf); - - lgd3d_z_normal = FALSE; - lgd3d_set_zwrite(TRUE); - lgd3d_set_znearfar(1.0, 20.0); -} -#endif -} - - -GUID *d3dtestParseArgs(int argc, const char **argv) -{ - int i, device=-1, num_devices; - - tb_default_mode = GRM_640x480x16; - - for (i=1; i=num_devices)) - device = num_devices-1; - - device_info = lgd3d_get_device_info(device); -// device_info->flags |= LGD3DF_ZBUFFER|LGD3DF_SPEW; - - mprintf("Using %s\n", device_info->p_ddraw_desc); - - return device_info->p_ddraw_guid; -} - -bool d3dtestLoop(void ) -{ - do_gfx(); - return get_input(); -} - -void d3dtestInit(void ) -{ - tb_init(); - init(); -} - -// this is the last atexit() called before the AppAgg gets destroyed -void d3dtestExit(void ) { -} - diff --git a/libsrc/lgd3d/d3dtest.h b/libsrc/lgd3d/d3dtest.h deleted file mode 100644 index 08e9d34..0000000 --- a/libsrc/lgd3d/d3dtest.h +++ /dev/null @@ -1,5 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/d3dtest.h 1.3 1997/10/29 15:51:11 KEVIN Exp $ -extern GUID *d3dtestParseArgs(int argc, const char **argv); -extern bool d3dtestLoop(); -extern void d3dtestInit(); -extern void d3dtestExit(); diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp new file mode 100644 index 0000000..ec13d90 --- /dev/null +++ b/libsrc/lgd3d/d6Base.cpp @@ -0,0 +1,7 @@ +#include + +static int lgd3d_get_error(DWORD *pdwCode, unsigned long *phResult); + +void SetLGD3DErrorCode(DWORD dwCode, long hRes); +const char *GetLgd3dErrorCode(DWORD dwErrorCode); +const char *GetDDErrorMsg(long hRes); diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp new file mode 100644 index 0000000..4c4c3f1 --- /dev/null +++ b/libsrc/lgd3d/d6Enum.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int lgd3d_enumerate_devices(); +int lgd3d_enumerate_devices_capable_of(unsigned long flags); +void lgd3d_unenumerate_devices(); +lgd3ds_device_info *lgd3d_get_device_info(int device_number); + +int c_DDEnumCallback(GUID *lpGUID, const char *lpDriverDescription, const char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); +void GetDevices(LGD3D_sEnumerationInfo *info); +int c_EnumDisplayModesCallback(DDSURFACEDESC2 *pSD, char *data); +int c_EnumDevicesCallback(GUID *lpGuid, const char *lpDeviceDescription, const char *lpDeviceName, D3DDEVICEDESC *pDeviceDesc, D3DDEVICEDESC *lpD3DHELDeviceDesc, void *lpUserArg); \ No newline at end of file diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp new file mode 100644 index 0000000..1fd0975 --- /dev/null +++ b/libsrc/lgd3d/d6Frame.cpp @@ -0,0 +1,65 @@ +#include +#include +#include + +class cD6Frame { +public: + cD6Frame(ILGSurface *pILGSurface); + cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info *psDeviceInfo); + ~cD6Frame(); + +private: + void InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags); + void InitializeEnvironment(lgd3ds_device_info *psDeviceInfo); + long GetDDstuffFromDisplay(); + long CreateDepthBuffer(); + int CreateD3D(const GUID & sDeviceGUID); + void ExamineRenderingCapabilities(); + +private: + DWORD m_dwRequestedFlags; + int m_bDepthBuffer; + DWORD m_dwTextureOpCaps; + IWinDisplayDevice * m_pWinDisplayDevice; +}; + +cD6Frame::cD6Frame(ILGSurface *pILGSurface) +{ +} + +cD6Frame::cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info *psDeviceInfo) +{ +} + +cD6Frame::~cD6Frame() +{ +} + +void cD6Frame::InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags) +{ +} + +void cD6Frame::InitializeEnvironment(lgd3ds_device_info *psDeviceInfo) +{ +} + +long cD6Frame::GetDDstuffFromDisplay() +{ + return 0; +} + +long cD6Frame::CreateDepthBuffer() +{ + return 0; +} + +int cD6Frame::CreateD3D(const GUID &sDeviceGUID) +{ + return 0; +} + +void cD6Frame::ExamineRenderingCapabilities() +{ +} + +int c_EnumZBufferFormats(DDPIXELFORMAT *lpDDPixFmt, void *lpContext); diff --git a/libsrc/lgd3d/d6Intfc.cpp b/libsrc/lgd3d/d6Intfc.cpp new file mode 100644 index 0000000..693b722 --- /dev/null +++ b/libsrc/lgd3d/d6Intfc.cpp @@ -0,0 +1,124 @@ +#include +#include +#include +#include +#include + +void lgd3d_set_RGB(); +void lgd3d_set_hardware(); +void lgd3d_set_software(); +int lgd3d_is_RGB(); +int lgd3d_is_hardware(); +void lgd3d_texture_set_RGB(uint8 is_RGB); +int lgd3d_init(lgd3ds_device_info *device_info); +int lgd3d_attach_to_lgsurface(ILGSurface *pILGSurface); +void lgd3d_clean_render_surface(int bDepthBuffToo); +void lgd3d_shutdown(); +int lgd3d_set_poly_mode(ePolyMode eNewMode); +ePolyMode lgd3d_get_poly_mode(); +void lgd3d_start_frame(int frame); +void lgd3d_end_frame(); +int lgd3d_overlays_master_switch(int bOverlaysOn); +int lgd3d_release_indexed_primitives(); +int lgd3d_rgb_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); +int lgd3d_rgba_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); +int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); +int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); +int lgd3d_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); +int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); +void lgd3d_tmap_setup(grs_bitmap *bm); +void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); +int lgd3d_rgblit_trifan(int n, r3s_point **ppl); +int lgd3d_rgblit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); +void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); +int lgd3d_rgbalit_trifan(int n, r3s_point **ppl); +int lgd3d_rgbalit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); +void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); +int lgd3d_rgbafoglit_trifan(int n, r3s_point **ppl); +int lgd3d_rgbafoglit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); +void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); +int lgd3d_diffspecular_trifan(int n, r3s_point **ppl); +int lgd3d_diffspecular_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); +void lgd3d_lit_tmap_setup(grs_bitmap *bm); +void lgd3d_poly_setup(); +void lgd3d_spoly_setup(); +void lgd3d_rgb_poly_setup(); +int lgd3d_rgb_poly(int n, r3s_point **ppl); +void lgd3d_rgba_poly_setup(); +int lgd3d_rgba_poly(int n, r3s_point **ppl); +int lgd3d_draw_point(r3s_point *p); +void lgd3d_set_zwrite(int zwrite); +void lgd3d_set_zcompare(int zwrite); +void lgd3d_zclear(); +void lgd3d_set_znearfar(long double znear, long double zfar); +void setwbnf(IDirect3DDevice3 *lpDev, long double dvWNear, long double dvWFar); +void lgd3d_get_znearfar(long double *pdZNear, long double *pdZFar); +void lgd3d_set_pal(int start, int n, uint8 *pal_data); +void lgd3d_set_pal_slot(int start, int n, uint8 *pal_data, int slot); +void lgd3d_set_pal_slot_flags(int start, int n, uint8 *pal_data, int slot, char flags); +void lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask *bitmask); +void lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask *bitmask); +void lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask *bitmask); +void lgd3d_set_texture_clut(uint8 *clut); +uint8 *lgd3d_set_clut(uint8 *clut); +void lgd3d_set_fog_level(float fog_level); +void lgd3d_set_fog_color(int r, int g, int b); +void lgd3d_set_fog_enable(int enable); +void lgd3d_set_fog_density(float density); +int lgd3d_use_linear_table_fog(int bUseIt); +void lgd3d_set_fog_start_end(float fStart, float fEnd); +void lgd3d_set_linear_fog_distance(float fDistance); +void lgd3d_set_alpha(float alpha); +void lgd3d_set_blend(int do_blend); +void lgd3d_blend_multiply(int blend_mode); +void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1); +void lgd3d_blend_normal(); +void lgd3d_set_offsets(int x, int y); +void lgd3d_get_offsets(int *x, int *y); +void lgd3d_set_z(float z); +void lgd3d_disable_palette(); +void lgd3d_enable_palette(); +void lgd3d_hack_light(r3s_point *p, float r); +void lgd3d_hack_light_extra(r3s_point *p, float r, grs_bitmap *bm); +void lgd3d_draw_line(r3s_point *p0, r3s_point *p1); +int lgd3d_trifan(int n, r3s_point **vpl); +int lgd3d_lit_trifan(int n, r3s_point **vpl); +int lgd3d_poly(int n, r3s_point **vpl); +int lgd3d_spoly(int n, r3s_point **vpl); +int lgd3d_g2upoly(int n, g2s_point **vpl); +int lgd3d_g2poly(int n, g2s_point **vpl); +int lgd3d_g2utrifan(int n, g2s_point **vpl); +int lgd3d_g2trifan(int n, g2s_point **vpl); +void lgd3d_set_light_map_method(unsigned int flag); +int lgd3d_TrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_LitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_RGBlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_RGBAlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_RGBAFoglitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_DiffuseSpecularMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); +int lgd3d_g2UTrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **vptc); +int lgd3d_g2TrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **vptc); +void lgd3d_set_texture_level(int n); +double lgd3d_set_zbias(long double new_bias); +void lgd3d_push_zbias_i(unsigned int nZBias); +void lgd3d_pop_zbias(); +void lgd3d_set_chromakey(int red, int green, int blue); +void lgd3d_set_alpha_pal(unsigned __int16 *pal); +void lgd3d_blit(); +void lgd3d_clear(int color_index); +D3DZBUFFERTYPE lgd3d_get_depth_buffer_state(); +int lgd3d_is_zwrite_on(); +int lgd3d_is_zcompare_on(); +int lgd3d_is_alpha_blending_on(); +int lgd3d_set_shading(int bSmoothShading); +int lgd3d_is_smooth_shading_on(); +int lgd3d_is_fog_on(); +void lgd3d_set_texture_map_method(unsigned int flag); +void lgd3d_get_texblending_modes(unsigned int *pulLevel0Mode, unsigned int *pulLevel1Mode); +void lgd3d_set_dithering(int bOn); +int lgd3d_is_dithering_on(); +void lgd3d_set_antialiasing(int bOn); +int lgd3d_is_antialiasing_on(); +int lgd3d_enable_specular(int bUseIt); +int lgd3d_get_texture_wrapping(unsigned int dwLevel); +int lgd3d_set_texture_wrapping(unsigned int dwLevel, int bSetSmooth); \ No newline at end of file diff --git a/libsrc/lgd3d/d6Over.cpp b/libsrc/lgd3d/d6Over.cpp new file mode 100644 index 0000000..85c2d1c --- /dev/null +++ b/libsrc/lgd3d/d6Over.cpp @@ -0,0 +1,105 @@ +#include + +#include +#include +#include + +struct sOverRectangle +{ + float fX0, fU0, fY0, fV0; + float fX1, fU1, fY1, fV1; +}; + +struct sLGD3DOverlayInfo +{ + DWORD dwFlags; + grs_bitmap *pBitmap; + float fX0, fY0; + float fX1, fY1; + float tu0, tv0; + float tu1, tv1; + int nAlpha, nRed, nGreen, nBlue; +}; + +struct sBaseOverData +{ + float fX0, fY0; + float fX1, fY1; + float fU0, fV0; + float fU1, fV1; + DWORD dwColor; + bool bReady; +}; + +class cD6AlphaOverlay : public cD6OvelayType +{ + enum + { + kBitmapUnlocked = 0xFF + }; + +public: + cD6AlphaOverlay(const cD6AlphaOverlay &); + cD6AlphaOverlay(); + virtual ~cD6AlphaOverlay(); + void SetPositionF(float fX, float fY); + void Move(float fDeltaX, float fDeltaY); + void SetAlpha(int nAlpha); + void SetColor(int nRed, int nGreen, int nBlue, int nAlpha); + void SetOverlayBaseData(sLGD3DOverlayInfo *psOverInfo); + void UpdateOverlayBaseData(sLGD3DOverlayInfo *psOverInfo); + virtual void DrawOverlay() override; + long PrepareOverlay(); + long LockAndGetBitmap(grs_bitmap **ppsBitmap); + long UnLockAndReload(); + +private: + void SetBitmap(grs_bitmap *psBitmap); + +private: + int m_bAlphaBlend; + int m_bTextureLoaded; + int m_nTexID; + grs_bitmap *m_psBitmap; + + sBaseOverData m_sOverData; + D3DTLVERTEX m_saVertices[4]; +}; + +class cD6OverlayHandler +{ +public: + cD6OverlayHandler(const cD6OverlayHandler &); + cD6OverlayHandler(); + ~cD6OverlayHandler(); + + void AddOverlay(cD6OvelayType *pcNewOver, unsigned long *phOver); + void InsertOverlayAfter(cD6OvelayType *pcNewOver, cD6OvelayType *pcAfterOver, unsigned long *phOver); + void RemoveOverlay(cD6OvelayType *pcOver); + void RemoveAllOverlays(); + void KillBranch(cD6OvelayType *pcOver); + void SetClipViewport(sOverRectangle *psInRect); + void GetClipViewport(sOverRectangle *psInRect); + void DrawOverlays(); + int OverlayFromHandle(unsigned long hOver, cD6OvelayType **ppcAlphaOver); + int AlphaOverlayFromHandle(unsigned long hOver, cD6AlphaOverlay **ppcAlphaOver); + unsigned long MakeNewOverlayHandle(cD6OvelayType *pcOver); + +private: + cD6OvelayType m_cListHead; +}; + +int lgd3d_aol_add(sLGD3DOverlayInfo *psOverInfo, unsigned int *phOver); +int lgd3d_aol_insert(sLGD3DOverlayInfo *psOverInfo, unsigned int hAfterMe, unsigned int *phOver); +int lgd3d_aol_remove(unsigned int hOver); +void lgd3d_aol_remove_all(); +int lgd3d_aol_switch(unsigned int hOver, int bOn); +int lgd3d_aol_update(unsigned int hOver, sLGD3DOverlayInfo *psOverInfo); +int lgd3d_aol_lock_bitmap_data(unsigned int hOver, grs_bitmap **ppsBitmap); +int lgd3d_aol_unlock_bitmap_data(unsigned int hOver); +int lgd3d_aol_set_position(unsigned int hOver, float fScreenX, float fScreenY); +int lgd3d_aol_move(unsigned int hOver, float fDeltaX, float fDeltaY); +int lgd3d_aol_set_color(unsigned int hOver, unsigned int nRed, unsigned int nGreen, unsigned int nBlue, unsigned int nAlpha); +int lgd3d_aol_set_alpha(unsigned int hOver, unsigned int nAlpha); +void lgd3d_aol_set_clip_rect(sOverRectangle *psInRect); +void lgd3d_aol_get_clip_rect(sOverRectangle *psOutRect); diff --git a/libsrc/lgd3d/d6Over.h b/libsrc/lgd3d/d6Over.h new file mode 100644 index 0000000..356f283 --- /dev/null +++ b/libsrc/lgd3d/d6Over.h @@ -0,0 +1,19 @@ +#pragma once + +class cD6OverlayHandler; + +class cD6OvelayType { + cD6OvelayType(const class cD6OvelayType &); + cD6OvelayType(); + virtual ~cD6OvelayType(); + + void TurnOnOff(bool bOn); + virtual void DrawOverlay(); + + unsigned long m_dwID; + cD6OverlayHandler * m_pcParent; + cD6OvelayType * m_pcNext; + cD6OvelayType * m_pcPrevious; + int m_bVisible; + int m_bTurnedOff; +}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h new file mode 100644 index 0000000..eea341f --- /dev/null +++ b/libsrc/lgd3d/d6Prim.h @@ -0,0 +1,127 @@ +#pragma once + +#include + +#include +#include +#include +#include + +class cD6Primitives { +protected: + cD6Primitives(const class cD6Primitives &); + cD6Primitives(); + ~cD6Primitives(); + +public: + cD6Primitives * DeInstance(); + +private: + int m_bPrimitivesPending; + int m_bFlushingOn; + int m_nAlpha; + unsigned long m_dcFogSpecular; + int m_bPointMode; + int m_iSavedTexId; + enum ePolyMode m_ePolyMode; + +public: + ePolyMode GetPolyMode(); + int SetPolyMode(ePolyMode eNewMode); + +protected: + void DrawStandardEdges(void *pVertera, unsigned int dwNoVeriteces); + +public: + virtual void FlushPrimitives(); + void PassFogSpecularColor(unsigned int dcFogColor); + void PassAlphaColor(int nAlapha); + virtual void StartFrame(); + virtual void EndFrame(); + virtual void Clear(int c); + virtual void StartNonTexMode(); + virtual void EndNonTexMode(); + +private: + unsigned long m_dwNoCashedPoints; + unsigned long m_dwPointBufferSize; + D3DTLVERTEX m_saPointBuffer[50]; + + D3DTLVERTEX m_saVertexBuffer[50]; + unsigned long m_dwNoCashedVertices; + unsigned long m_dwVertexBufferSize; + +public: + virtual D3DTLVERTEX * ReservePointSlots(int n); + virtual void FlushPoints(); + void SetPointBufferSize(unsigned long); // static? + unsigned long GetPointBufferSize(); // static? + virtual int DrawPoint(r3s_point *p); + + D3DTLVERTEX * ReservePolySlots(int n); + virtual void DrawPoly(bool bSuspendTexturing); + virtual int Poly(int n, r3s_point * * ppl); + virtual int SPoly(int n, r3s_point * * ppl); + virtual int RGB_Poly(int n, r3s_point * * ppl); + virtual int RGBA_Poly(int n, r3s_point * * ppl); + virtual int Trifan(int n, r3s_point * * ppl); + virtual int LitTrifan(int n, r3s_point * * ppl); + virtual int RGBlitTrifan(int n, r3s_point * * ppl); + virtual int RGBAlitTrifan(int n, r3s_point * * ppl); + virtual int RGBAFogLitTrifan(int n, r3s_point * * ppl); + virtual int DiffuseSpecularLitTrifan(int n, r3s_point * * ppl); + virtual int g2UPoly(int n, g2s_point * * ppl); + virtual int g2Poly(int n, g2s_point * * ppl); + virtual int g2UTrifan(int n, g2s_point * * ppl); + virtual int g2Trifan(int n, g2s_point * * ppl); + void DrawLine(r3s_point * p0, r3s_point * p1); + +protected: + virtual void InitializeVIBCounters(); + virtual int CreateVertIndBuffer(DWORD dwInitialNoEntries); + virtual void DeleteVertIndBuffer(); + virtual int ResizeVertIndBuffer(DWORD dwNewNoEntries); + +private: + D3DTLVERTEX * m_pVIB; + DWORD m_dwNoVIBEntries; + DWORD m_dwVIBSizeInEntries; + unsigned short m_waIndices[256]; + DWORD m_dwVIBmax; + DWORD m_dwNoIndices; + unsigned short m_waTempIndices[50]; + DWORD m_dwMinVIndex; + DWORD m_dwMaxVIndex; + DWORD m_dwTempIndCounter; + grs_bitmap * m_hack_light_bm; + +public: + virtual void EndIndexedRun(); + virtual void FlushIfNoFit(int nIndicesToAdd, bool bSuspendTexturing); + virtual D3DTLVERTEX * GetIndPolySlot(int nPolySize, r3ixs_info *psIndInfo); + virtual void DrawIndPolies(); + virtual void FlushIndPolies(); + virtual int PolyInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int SPolyInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int RGB_PolyInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int RGBA_PolyInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int TrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int LitTrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int RGBlitTrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int RGBAlitTrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + int RGBAFogLitTrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + int DiffuseSpecularLitTrifanInd(int n, r3s_point **ppl, r3ixs_info *psIndInfo); + virtual int TrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int LitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int RGBlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int RGBAlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int RGBAFogLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int DiffuseSpecularLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); + virtual int g2UTrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc); + virtual int g2TrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc); + + void init_hack_light_bm(); + void do_quad_light(r3s_point *p, float r, grs_bitmap *bm); + void HackLight(r3s_point *p, float r); + void HackLightExtra(r3s_point *p, float r, grs_bitmap *bm); +}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6Prim_s.cpp b/libsrc/lgd3d/d6Prim_s.cpp new file mode 100644 index 0000000..d6c24fc --- /dev/null +++ b/libsrc/lgd3d/d6Prim_s.cpp @@ -0,0 +1,59 @@ +#include + +struct MTVERTEX +{ + float sx, sy, sz, rhw; + unsigned int color, specular; + float tu, tv, tu2, tv2; +}; + +class cImBuffer : public cD6Primitives +{ +private: + static cImBuffer *m_Instance; + + cImBuffer(const class cImBuffer &); + cImBuffer(); + ~cImBuffer(); + +public: + cD6Primitives *Instance(); + virtual cD6Primitives *DeInstance() override; +}; + +class cMSBuffer : public cD6Primitives +{ +private: + static cMSBuffer *m_Instance; + + cMSBuffer(const class cMSBuffer &); + cMSBuffer(); + ~cMSBuffer(); + +public: + cD6Primitives *Instance(); + virtual cD6Primitives *DeInstance() override; + +private: + MTVERTEX m_saMTVertices[0x32]; + DWORD m_dwNoMTVertices; + DWORD m_dwMaxNoMTVertices; + +private: + virtual void DrawPoly(bool bSuspendTexturing) override; + virtual void FlushIndPolies() override; + virtual void DrawIndPolies() override; + + MTVERTEX *ReserveMTPolySlots(int n); + void DrawMTPoly(); + +public: + virtual int TrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int LitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int RGBlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int RGBAlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int RGBAFogLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int DiffuseSpecularLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; + virtual int g2UTrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc) override; + virtual int g2TrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc) override; +}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp new file mode 100644 index 0000000..9f4ddd8 --- /dev/null +++ b/libsrc/lgd3d/d6Render.cpp @@ -0,0 +1,53 @@ +#include "d6Render.h" + +cD6Renderer::cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) +{ +} + +cD6Renderer::~cD6Renderer() +{ +} + +cD6Renderer* cD6Renderer::Instance(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) +{ + return nullptr; +} + +cD6Renderer* cD6Renderer::DeInstance() +{ + return nullptr; +} + +void cD6Renderer::CreateStatesStack(DWORD dwInitialSize, DWORD dwEntrySize) +{ +} + +void cD6Renderer::DeleteStatesStack() +{ +} + +int cD6Renderer::SwitchOverlaysOnOff(bool bOn) +{ + return 0; +} + +void cD6Renderer::StartFrame(int nFrame) +{ +} + +void cD6Renderer::EndFrame() +{ +} + +void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) +{ +} + +void cD6Renderer::CleanRenderSurface(bool bDepthBufferToo) +{ +} + +long cD6Renderer::InitViewport() +{ + return 0; +} diff --git a/libsrc/lgd3d/d6Render.h b/libsrc/lgd3d/d6Render.h new file mode 100644 index 0000000..46a2901 --- /dev/null +++ b/libsrc/lgd3d/d6Render.h @@ -0,0 +1,39 @@ +#pragma once + +#include + +class cD6Renderer { +private: + static cD6Renderer* m_RendererInstance; + +protected: + cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags); + ~cD6Renderer(); + +public: + cD6Renderer* Instance(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags); + cD6Renderer* DeInstance(); + +private: + void CreateStatesStack(DWORD dwInitialSize, DWORD dwEntrySize); + void DeleteStatesStack(); + +public: + int SwitchOverlaysOnOff(bool bOn); + void StartFrame(int nFrame); + void EndFrame(); + void CleanDepthBuffer(int x1, int y1, int x2, int y2); + void CleanRenderSurface(bool bDepthBufferToo); + long InitViewport(); + + DWORD m_dwEntrySize; + DWORD m_dwNoEntries; + + DWORD m_dwStackTop; + char* m_pStackData; + + DWORD* m_pdwRSCData; + char* m_pCurrentEntry; + char* m_pSetEntry; + bool m_bOverlaysOn; +}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h new file mode 100644 index 0000000..7ba7577 --- /dev/null +++ b/libsrc/lgd3d/d6States.h @@ -0,0 +1,177 @@ +#pragma once + +#include +#include + +#include +#include + + +struct d3d_cookie { + uint8 wlog; + uint8 hlog; + uint8 flags; + uint8 palette; + unsigned long value; +}; + +struct tdrv_texture_info +{ + grs_bitmap *bm; + int id; + int flags; + int scale_w; + int scale_h; + int w; + int h; + int size_index; + uint8 *bits; + unsigned long cookie; +}; + +struct sTexBlendArgs +{ + D3DTEXTUREOP eColorOperation; + DWORD dwColorArg1; + DWORD dwColorArg2; + D3DTEXTUREOP eAlphaOperation; + DWORD dwAlphaArg1; + DWORD dwAlphaArg2; +}; + +struct sRenderStates +{ + int bUsePalette; + int nAlphaColor; + D3DSHADEMODE eShadeMode; + int bDitheringOn; + int bAntialiasingOn; + int bAlphaOn; + D3DBLEND eSrcAlpha; + D3DBLEND eDstAlpha; + D3DZBUFFERTYPE eZenable; + int bZWriteEnable; + D3DCMPFUNC eZCompareFunc; + int bFogOn; + DWORD dwFogColor; + D3DFOGMODE eFogMode; + float fFogTableDensity; + float fFogStart; + float fFogEnd; + unsigned long dcFogSpecular; + int bPerspectiveCorr; + DWORD dwNoLightMapLevels; + DWORD dwTexBlendMode[2]; + int naTextureId[2]; + int baTextureWithAlpha[2]; + int baChromaKeying[2]; + sTexBlendArgs saTexBlend[2]; + D3DTEXTUREADDRESS eWrap[2]; + int chroma_r; + int chroma_g; + int chroma_b; + unsigned long chroma_key; + D3DTEXTUREMINFILTER eMagTexFilter; + D3DTEXTUREMINFILTER eMinTexFilter; +}; + +class cD6States +{ +public: + virtual int Initialize(DWORD dwRequestedFlags); + +private: + unsigned long m_DeviceSurfaceCaps; + int *m_texture_size_list; + unsigned long m_texture_caps; + bool m_bTextureListInitialized; + sRenderStates *m_psCurrentRS; + sRenderStates *m_psSetRS; + bool m_bTexture_RGB; + bool m_bUsingLocalMem; + bool m_bLocalMem_available; + bool m_bAGP_available; + bool m_bWBuffer; + bool m_bCanDither; + bool m_bCanAntialias; + bool m_bSpecular; + bool m_bCanModulate; + bool m_bCanModulateAlpha; + +protected: + void EnumerateTextureFormats(); + void InitTextureManager(); + virtual int SetDefaultsStates(DWORD dwRequestedFlags); + void SetCommonDefaultStates(DWORD dwRequestedFlags, bool bMultiTexture); + + cD6States(const cD6States &); + cD6States(); + virtual ~cD6States(); + +public: + int load_texture(tdrv_texture_info *info); + void release_texture(int n); + void unload_texture(int n); + void synchronize(); + void start_frame(int n); + void end_frame(); + virtual void set_texture_id(int n); + virtual int reload_texture(tdrv_texture_info *info); + virtual void cook_info(tdrv_texture_info *info); + int reload_texture_a(tdrv_texture_info *info); + int load_texture_a(tdrv_texture_info *info); + void release_texture_a(int n); // maybe unsigned + virtual void SetLightMapMode(DWORD dwFlag); + virtual void SetTextureLevel(int n); + virtual int EnableMTMode(DWORD dwMTOn); + unsigned long GetRenderStatesSize(); + void SetPointerToCurrentStates(char *p); + void SetPointerToSetStates(char *p); + void *GetCurrentStates(); + long CreateDDSurface(d3d_cookie cookie, DDSURFACEDESC2 *pddsd, IDirectDrawSurface4 **ppDDS); + void LoadSurface(tdrv_texture_info *info, DDSURFACEDESC2 *pddsd); + int get_texture_id(); + virtual void TurnOffTexuring(bool bTexOff); + void SetTextureNow(); + virtual cD6States *DeInstance(); + void SetDithering(bool bOn); + int GetDitheringState(); + void SetAntialiasing(bool bOn); + int GetAntialiasingState(); + virtual void EnableDepthBuffer(int nFlag); + int GetDepthBufferState(); + virtual void SetZWrite(bool bZWriteOn); + bool IsZWriteOn(); + virtual void SetZCompare(bool bZCompreOn); + bool IsZCompareOn(); + virtual void SetFogDensity(float fDensity); + int UseLinearTableFog(bool bOn); + void SetFogStartAndEnd(float fStart, float fEnd); + void SetLinearFogDistance(float fDistance); + void SetAlphaColor(float fAlpha); + void EnableAlphaBlending(bool bAlphaOn); + bool IsAlphaBlendingOn(); + void SetAlphaModulateHack(int iBlendMode); + void ResetDefaultAlphaModulate(); + void SetTextureMapMode(DWORD dwFlag); + void GetTexBlendingModes(DWORD *pdw0LevelMode, DWORD *pdw1LevelMode); + int SetSmoothShading(bool bSmoothOn); + bool IsSmoothShadingOn(); + void EnableFog(bool bFogOn); + bool IsFogOn(); + void SetFogSpecularLevel(float fLevel); + void SetFogColor(int r, int g, int b); + unsigned long get_color(); + void SetTexturePalette(int start, int n, uint8 *pal, int slot); + void EnablePalette(bool bPalOn); + bool IsPaletteOn(); + void SetPalSlotFlags(int start, int n, uint8 *pal_data, int slot, char flags); + void SetAlphaPalette(uint16 *pal); + virtual void SetChromaKey(int r, int g, int b); + int GetTexWrapping(DWORD dwLevel); + int SetTexWrapping(DWORD dwLevel, bool bSetSmooth); + int EnableSpecular(bool bUseIt); + +private: + float LinearWorldIntoFogCoef(float fLin); +}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 25a1a40..60fe211 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -1,5 +1,71 @@ -#define PLAYTEST +#include "d6States.h" -#include +#include -BOOL lgd3d_blend_trans = TRUE; \ No newline at end of file +class cImStates : public cD6States +{ +public: + cD6States *Instance(); + virtual cD6States *DeInstance() override; + +protected: + cImStates(const class cImStates &); + cImStates(); + virtual ~cImStates(); + +private: + cImStates *m_Instance; +}; + +class cMSStates : public cD6States { +public: + cD6States * Instance(); + virtual cD6States * DeInstance() override; + virtual int Initialize(DWORD dwRequestedFlags) override; + virtual int SetDefaultsStates(DWORD dwRequestedFlags) override; + +protected: + cMSStates(const cMSStates &); + cMSStates(); + virtual ~cMSStates(); + +private: + cMSStates * m_Instance; + unsigned long m_dwCurrentTexLevel; + int m_bTexturePending; + grs_bitmap * m_LastLightMapBm; + +public: + virtual void set_texture_id(int n) override; + virtual int reload_texture(tdrv_texture_info *info) override; + virtual void cook_info(tdrv_texture_info *info) override; + virtual void SetLightMapMode(DWORD dwFlag) override; + virtual void SetTextureLevel(int n) override; + virtual int EnableMTMode(DWORD dwMTOn) override; + virtual void TurnOffTexuring(bool bTexOff) override; +}; + +void calc_size(tdrv_texture_info *info, d3d_cookie cookie); +void GetAvailableTexMem(unsigned int *local, unsigned int *agp); +void blit_8to16(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); +void blit_8to16_trans(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); +void blit_8to16_clut(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); +void blit_8to16_scale(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); +void blit_8to16_clut_scale(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); +void blit_8to8(tdrv_texture_info *info, unsigned __int8 *dst, int drow); +void blit_8to8_clut(tdrv_texture_info *info, unsigned __int8 *dst, int drow); +void blit_8to8_scale(tdrv_texture_info *info, unsigned __int8 *dst, int drow); +void blit_8to8_clut_scale(tdrv_texture_info *info, unsigned __int8 *dst, int drow); +void blit_16to16(tdrv_texture_info *info, uint16 *dst, int drow); +void blit_16to16_scale(tdrv_texture_info *info, uint16 *dst, int drow); +void blit_32to32(tdrv_texture_info *info, uint16 *dst, int drow); +void blit_32to32_scale(tdrv_texture_info *info, uint16 *dst, int drow); +void blit_32to16(tdrv_texture_info *info, uint16 *dst, unsigned int drow); +int EnumTextureFormatsCallback(_DDPIXELFORMAT *lpDDPixFmt, void *lpContext); +void CheckSurfaces(sWinDispDevCallbackInfo *info); +void InitDefaultTexture(int size); +int FindClosestColor(float r, float g, float b); +int init_size_tables(int **p_size_list); +void init_size_table(int *size_table, unsigned __int8 type); +int munge_size_tables(int **p_size_list); +int get_num_sizes(int *size_list, int num_sizes, int *size_table); diff --git a/libsrc/lgd3d/enum.cpp b/libsrc/lgd3d/enum.cpp deleted file mode 100644 index 662035c..0000000 --- a/libsrc/lgd3d/enum.cpp +++ /dev/null @@ -1,259 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/enum.cpp 1.7 1998/02/16 15:08:00 KEVIN Exp $ -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#ifndef SHIP -#include -#define spew(x) mprint(x) -#else -#define spew(x) -#pragma off(unreferenced) -#endif - - -#define MAX_DEVICES 10 -#define TEXTURE_FLAGS ( \ - D3DDEVCAPS_TEXTURENONLOCALVIDMEM| \ - D3DDEVCAPS_TEXTURESYSTEMMEMORY| \ - D3DDEVCAPS_TEXTUREVIDEOMEMORY) - -typedef struct lgd3ds_device_enum_info { - LPGUID p_ddraw_guid; - int device_number; - char * p_ddraw_desc; - short supported_modes[GRD_MODES]; - int num_supported; -} lgd3ds_device_enum_info; - -static int num_devices = -2; -static lgd3ds_device_info *device_list[MAX_DEVICES]; -static BOOL no_d3d = TRUE; - -#pragma off (unreferenced) -static HRESULT WINAPI -EnumDeviceCallback(LPGUID p_device_guid, - LPSTR description, - LPSTR name, - LPD3DDEVICEDESC device_desc, - LPD3DDEVICEDESC , - LPVOID user_arg) -{ - lgd3ds_device_enum_info *info = (lgd3ds_device_enum_info *)user_arg; - lgd3ds_device_info *device_info; - -// If there is no hardware support then the color model is zero. - - if (0UL == device_desc->dcmColorModel) - return D3DENUMRET_OK; - -#ifdef PRINT_ENUM - mprintf("Device Name: %s\n", name); - mprintf("Device Description: %s\n", description); -#endif - -// Does the device render at the depth we want? - - if (0UL == (device_desc->dwDeviceRenderBitDepth & DDBD_16)) { - spew("No 16 bit.\n"); - return D3DENUMRET_OK; - } - - if ((D3DCOLOR_RGB & device_desc->dcmColorModel)==0) { - spew("device not RGB.\n"); - return D3DENUMRET_OK; - } - - if ((device_desc->dpcTriCaps.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB)==0) { - spew("no color gouraud shading.\n"); - return D3DENUMRET_OK; - } - - if ((device_desc->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_ALPHA) == 0) { - spew("no alpha blending.\n"); - return D3DENUMRET_OK; - } - - - if ((device_desc->dwDevCaps & TEXTURE_FLAGS) == 0) { - spew("no texture mapping.\n"); - return D3DENUMRET_OK; - } - - if ((device_desc->dpcTriCaps.dwRasterCaps & - (D3DPRASTERCAPS_FOGTABLE|D3DPRASTERCAPS_FOGVERTEX)) == 0) { - spew("no fog available\n"); - return D3DENUMRET_OK; - } - -#if 0 - if ((device_desc->dwMaxTextureWidth < 256) || - (device_desc->dwMaxTextureHeight < 256) || - (device_desc->dwMinTextureWidth > 256) || - (device_desc->dwMinTextureHeight > 256)) { - spew("no 256x256 texture support\n"); - return D3DENUMRET_OK; - } -#endif - - // tbd: check for colorkey, etc. - - AssertMsg(info->device_number < MAX_DEVICES, "Too many d3d devices available."); - - int malloc_size = - sizeof (*device_info) + // info structure - (info->num_supported + 1) * sizeof(short) + // mode list - sizeof(DevDesc) + // D3D Device description - strlen(info->p_ddraw_desc) + 1; // ddraw driver description string - - if (info->p_ddraw_guid != NULL) { - device_info = (lgd3ds_device_info *)Malloc (malloc_size + sizeof(GUID)); - device_info->p_ddraw_guid = (GUID *)(((uchar *)device_info) + malloc_size); - CopyMemory(device_info->p_ddraw_guid, info->p_ddraw_guid, sizeof(GUID)); - } else { - device_info = (lgd3ds_device_info *)Malloc (malloc_size); - device_info->p_ddraw_guid = NULL; - } - - CopyMemory(&device_info->device_guid, p_device_guid, sizeof(GUID)); - - device_info->supported_modes = (short *)(device_info+1); - if (info->num_supported>0) - CopyMemory(device_info->supported_modes, &info->supported_modes[0], info->num_supported * sizeof(short)); - device_info->supported_modes[info->num_supported] = -1; - - device_info->device_desc = (DevDesc *)(&device_info->supported_modes[info->num_supported+1]); - *(device_info->device_desc) = *device_desc; - - device_info->p_ddraw_desc = (char *)(device_info->device_desc + 1); - strcpy(device_info->p_ddraw_desc, info->p_ddraw_desc); - - device_info->flags = 0; - - device_list[info->device_number++] = device_info; - - return D3DENUMRET_OK; -} -#pragma on (unreferenced) - - -static HRESULT WINAPI - EnumDisplayModesCallback(LPDDSURFACEDESC pSD, LPVOID data) -{ - lgd3ds_device_enum_info *info = (lgd3ds_device_enum_info *)data; - int mode = gr_mode_from_info(pSD->dwWidth, pSD->dwHeight, - pSD->ddpfPixelFormat.dwRGBBitCount); - - if (mode < 0) - return D3DENUMRET_OK; - - // first make sure we haven't already listed this mode as supported - int i; - for (i=0; inum_supported; i++) - if (info->supported_modes[i] == mode) break; - - if (inum_supported) - return D3DENUMRET_OK; - - info->supported_modes[info->num_supported++] = (short )mode; - return D3DENUMRET_OK; -} - -static void GetDevices(lgd3ds_device_enum_info *info) -{ - HRESULT hRes; - LPD3DI lpd3d; - LPDIRECTDRAW lpdd; - -// get directdraw object - - hRes = DynDirectDrawCreate(info->p_ddraw_guid, &lpdd, NULL); - AssertMsg(!FAILED(hRes), "Can't create ddraw object."); - -// get direct3d object - - hRes = lpdd->QueryInterface(IID_ID3D, (void **)&lpd3d); - if ((FAILED(hRes)) || (NULL == lpd3d)) { - SafeRelease(lpdd); - return; - } - no_d3d = FALSE; - - info->num_supported = 0; - lpdd->EnumDisplayModes(0, NULL, info, EnumDisplayModesCallback); - - if (info->num_supported > 0) { - hRes = lpd3d->EnumDevices(EnumDeviceCallback, info); - AssertMsg(!FAILED(hRes), "EnumDevices failed."); - } - - SafeRelease(lpd3d); - SafeRelease(lpdd); -} - -#pragma off (unreferenced) -static BOOL PASCAL DDEnumCallback(LPGUID guid, char *desc, char *name, void *user_arg) -{ - lgd3ds_device_enum_info *info = (lgd3ds_device_enum_info *)user_arg; - -#ifdef PRINT_ENUM - mprintf("ddraw name: %s\n", name); - mprintf("ddraw description: %s\n", desc); -#endif - - info->p_ddraw_guid = guid; - info->p_ddraw_desc = desc; - GetDevices(info); - - return DDENUMRET_OK; -} -#pragma on (unreferenced) - -// returns -1 if direct draw is unavailable, -// number of suitable devices available otherwise -int lgd3d_enumerate_devices(void) -{ - lgd3ds_device_enum_info info; - - if (num_devices >= -1) - return num_devices; - - if (!LoadDirectDraw()) - return num_devices = -1; - - info.device_number = 0; - DynDirectDrawEnumerate(DDEnumCallback, &info); - if (no_d3d && (info.device_number == 0)) - // we couldn't get any d3d object - num_devices = -1; - else - num_devices = info.device_number; - return num_devices; -} - -void lgd3d_unenumerate_devices(void) -{ - for (int i=0; i device_number, "Invalid device number"); - return device_list[device_number]; -} - - diff --git a/libsrc/lgd3d/lgSS2P.h b/libsrc/lgd3d/lgSS2P.h deleted file mode 100644 index 3340128..0000000 --- a/libsrc/lgd3d/lgSS2P.h +++ /dev/null @@ -1,14 +0,0 @@ -/* -@Copyright Looking Glass Studios, Inc. -1996,1997,1998,1999,2000 Unpublished Work. -*/ - -//# $Header: x:/prj/tech/libsrc/lgd3d/RCS/lgss2p.h 1.1 1999/10/21 16:56:48 MAT Exp $ - -#ifndef _LGSS2P_H -#define _LGSS2P_H - -EXTERN BOOL b_SS2_UseSageTexManager; - - -#endif //_LGSS2P_H diff --git a/libsrc/lgd3d/lgSurf.cpp b/libsrc/lgd3d/lgSurf.cpp new file mode 100644 index 0000000..3e2e9d2 --- /dev/null +++ b/libsrc/lgd3d/lgSurf.cpp @@ -0,0 +1,3 @@ +#include + +BOOL CreateLGSurface(ILGSurface **ppILGSurf); \ No newline at end of file diff --git a/libsrc/lgd3d/lgSurf_i.h b/libsrc/lgd3d/lgSurf_i.h new file mode 100644 index 0000000..27f511d --- /dev/null +++ b/libsrc/lgd3d/lgSurf_i.h @@ -0,0 +1,74 @@ +#pragma once + +#include +#include +#include + +struct sLGSurfaceDescription +{ + DWORD dwWidth; + DWORD dwHeight; + DWORD dwBitDepth; + DWORD dwPitch; + grs_rgb_bitmask sBitmask; +}; + +enum eLGSBlit +{ + kLGSBRead = 1, + kLGSBWrite = 2, + kLGSBReadWrite = 3 +}; + +enum eLGSurfState +{ + kLGSSUninitialized = 1, + kLGSSInitialized = 2, + kLGSSUnlocked = 3, + kLGSS3DRenderining = 4, + kLGSS2DLocked = 5, + kLGSS2DBlitting = 6 +}; + +class ILGSurface : public IUnknown +{ +public: + ILGSurface(); + ILGSurface(const ILGSurface &); + virtual ~ILGSurface(); + + // virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); + // virtual ULONG STDMETHODCALLTYPE AddRef(); + // virtual ULONG STDMETHODCALLTYPE Release(); + + virtual int CreateInternalScreenSurface(HWND hMainWindow) = 0; + virtual int ChangeClipper(HWND hMainWindow) = 0; + virtual int SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD *pdwCapabilityFlags, grs_canvas **ppsCanvas) = 0; + virtual int Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD *pdwCapabilityFlags, grs_canvas **ppsCanvas) = 0; + virtual int BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) = 0; + virtual void CleanSurface() = 0; + virtual void Start3D() = 0; + virtual void End3D() = 0; + virtual long LockFor2D(grs_canvas **ppsCanvas, eLGSBlit eBlitFlags) = 0; + virtual long UnlockFor2D() = 0; + virtual DWORD GetWidth() = 0; + virtual DWORD GetHeight() = 0; + virtual DWORD GetPitch() = 0; + virtual DWORD GetBitDepth() = 0; + virtual eLGSurfState GetSurfaceState() = 0; + virtual long GetSurfaceDescription(sLGSurfaceDescription *psDsc) = 0; +}; + +class ILGDD4Surface : public IUnknown +{ +public: + ILGDD4Surface(); + ILGDD4Surface(const ILGDD4Surface &); + virtual ~ILGDD4Surface(); + + int GetDeviceInfoIndex(); + int GetDirectDraw(IDirectDraw4 **ppDD); + int GetRenderSurface(IDirectDrawSurface4 **ppRS); +}; + +BOOL CreateLGSurface(ILGSurface **ppILGSurf); \ No newline at end of file diff --git a/libsrc/lgd3d/lgd3d.cpp b/libsrc/lgd3d/lgd3d.cpp deleted file mode 100644 index 123c73e..0000000 --- a/libsrc/lgd3d/lgd3d.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "lgd3d.h" -#include - -// TODO - -BOOL b_SS2_UseSageTexManager; - -EXTERN BOOL lgd3d_blend_trans = TRUE; - -void lgd3d_set_light_map_method(ulong flag) -{ - // TODO -} - -int lgd3d_TrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) -{ - return 0; // TODO -} diff --git a/libsrc/lgd3d/lgd3d.h b/libsrc/lgd3d/lgd3d.h deleted file mode 100644 index dcdd18b..0000000 --- a/libsrc/lgd3d/lgd3d.h +++ /dev/null @@ -1,438 +0,0 @@ -/* -@Copyright Looking Glass Studios, Inc. -1996,1997,1998,1999,2000 Unpublished Work. -*/ - -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/lgd3d.h 1.59 1970/01/01 00:00:00 Zarko Exp $ - -#ifndef __LGD3D_H -#define __LGD3D_H - - -#include -#include - -#include - - - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct ILGSurface ILGSurface; - - typedef struct _D3DDeviceDesc DevDesc; - - typedef struct lgd3ds_device_info { - GUID device_guid; - GUID* p_ddraw_guid; - DevDesc* device_desc; - short* supported_modes; // -1 terminated list - char* p_ddraw_desc; - ulong flags; - } lgd3ds_device_info; - - - extern int lgd3d_enumerate_devices(void); - extern lgd3ds_device_info* lgd3d_get_device_info(int device); - - - //////////////NEW in a 50% bigger packaging!!!//////////////////////////// - - /// lgd3ds_device_info flags passed to the libray - /// or returned by the enumeration. - - extern int lgd3d_enumerate_devices_capable_of(ulong flags); - -#define LGRT_SINGLE_TEXTURE_SINGLE_PASS 0L -#define LGRT_MULTI_TEXTURE_SINGLE_PASS 1L - - //NOTE: multipass multitexturing is not supported!!! - - // Capabilities that can be requested: - -#define LGD3DF_SPEW 0x00000002L - -//depth buffer: -#define LGD3DF_ZBUFFER 0x00000001L // Z-buffer -#define LGD3DF_WBUFFER 0x00000004L // W-buffer -#define LGD3DF_DEPTH_BUFFER_REQUIRED 0x00000008L // the -// selected (Z_ or W-) depth buffer REQUIRED! -//fog: -#define LGD3DF_TABLE_FOG 0x00000010L // table based pixel fog -#define LGD3DF_VERTEX_FOG 0x00000020L - -//dithering -#define LGD3DF_DITHER 0x00000040L // use dithering - -//antialiasing -#define LGD3DF_ANTIALIAS 0x00000080L // use (sort independent) antialiasing - -#define LGD3DF_MULTI_TEXTURING 0x00000100L // we support ONLY two sets of textures and -// and texture coordinates - -#define LGD3DF_MODULATEALPHA 0x00000200L // we want to use modulate alpha for single texture mode -#define LGD3DF_BLENDDIFFUSE 0x00000400L // we want to use blend diffuse for single texture mode - -#define LGD3DF_MULTITEXTURE_COLOR 0x00000800L // we want to use color light maps for single or multi texture mode -#define LGD3DF_MULTITEXTURE_ALPHA 0x00001000L // we want to use alpha light maps for single or multi texture mode - -#define LGD3DF_DO_WINDOWED 0x00002000L - -#define LGD3DF_MT_BLENDDIFFUSE 0x00004000L // we want to use alpha light maps for single or multi texture mode - -// Supported capabilities: (returned by the enumeration) - -//depth buffer -#define LGD3DF_CAN_DO_ZBUFFER 0x00010000L -#define LGD3DF_CAN_DO_WBUFFER 0x00040000L // W-buffer -//fog: -#define LGD3DF_CAN_DO_TABLE_FOG 0x00080000L // table based pixel fog -#define LGD3DF_CAN_DO_VERTEX_FOG 0x00100000L // vertex fog -//dithering -#define LGD3DF_CAN_DO_DITHER 0x00200000L // can dither -#define LGD3DF_CAN_DO_ANTIALIAS 0x00400000L // can use (sort independent) antialiasing - -#define LGD3DF_CAN_DO_SINGLE_PASS_MT 0x02000000L // we can do single pass double texturing -#define LGD3DF_CAN_DO_WINDOWED 0x04000000L // we can play the game in lil' window - -#define LGD3DF_CAN_DO_ITERATE_ALPHA 0x08000000L // can do Gouraud interpolation between vetices alpha color - - -/////////////////////////////////////////////////////////////////////////// - - - - -// Constants passed to lgd3d_set_pal_slot_flags() -#define LGD3DPALF_OPAQUE 1 -#define LGD3DPALF_TRANS 2 - -// pre-initiazation calls - extern void lgd3d_set_RGB(void); - extern void lgd3d_set_hardware(void); - extern void lgd3d_set_software(void); - extern void lgd3d_texture_set_RGB(bool is_RGB); - - // state query functions (won't change between init and shutdown) - extern BOOL lgd3d_is_RGB(void); - extern BOOL lgd3d_is_hardware(void); - - // initialization and shutdown - - //@TODO change this to return HRESULT error codes and support the message strings for them - - extern BOOL lgd3d_init(lgd3ds_device_info* device_info); - // N.B. If the flag LGD3DF_DEPTH_BUFFER_REQUIRED was set in device_info->flags, - // and a depth buffer could not be created the call would fail. To test for this - // condition check whether the flags LGD3DF_ZBUFFER and LGD3DF_WBUFFER - // was UNSET in device_info->flags. - - - - extern BOOL lgd3d_attach_to_lgsurface(ILGSurface* pILGSurface); - extern void lgd3d_clean_render_surface(BOOL bDepthBuffToo); - - extern void lgd3d_shutdown(void); - - extern void lgd3d_start_frame(int frame); // frame count passed to texture manager - extern void lgd3d_end_frame(void); - - extern BOOL lgd3d_overlays_master_switch(BOOL bOverlaysOn); - - - - extern void lgd3d_blit(); - extern void lgd3d_clear(int color_index); - - // application direct interface: death to COM! - extern void lgd3d_set_zwrite(BOOL zwrite); - extern void lgd3d_set_zcompare(BOOL zwrite); - extern void lgd3d_zclear(void); - extern void lgd3d_set_znearfar(double znear, double zfar); - extern void lgd3d_get_znearfar(double* pdZNear, double* pdZFar); - - extern BOOL lgd3d_z_normal; - - //z-stuff - extern void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1); - extern void lgd3d_set_z(float z); // z coord for flat (2d) polys - - extern int lgd3d_get_depth_buffer_state(void); - extern int lgd3d_is_zwrite_on(void); - extern int lgd3d_is_zcompare_on(void); - - // push all points closer to camera by zbias. - // returns old zbias. - extern double lgd3d_set_zbias(double zbias); - - // Z-Bias stack -#define LGD3D_ZBIAS_STACK_DEPTH 8 - -// 0 <= nZbias <= 16 - extern void lgd3d_push_zbias_i(int nZBias); - extern void lgd3d_pop_zbias(void); - - // States - - - //shading - // "smooth"(i.e., linera or bilinear) or "nearest point" - extern BOOL lgd3d_set_shading(BOOL bSmoothShading); //NEW - extern BOOL lgd3d_is_smooth_shading_on(void); - - - - //alpha blending - extern int lgd3d_is_alpha_blending_on(void); - - extern void lgd3d_set_alpha(float alpha); // 0.0 <= alpha <= 1.0 - extern void lgd3d_set_blend(BOOL do_blend); - extern void lgd3d_blend_normal(void); - - extern void lgd3d_blend_multiply(int blend_mode); //from below - enum { - BLEND_DEST_ZERO = 0, - BLEND_SRC_ZERO = 0, - BLEND_SRC_ONE = 1, - BLEND_SRC_SRC = 2, - BLEND_SRC_DEST = 3, - BLEND_DEST_ONE = 4, - BLEND_DEST_SRC = 8, - BLEND_DEST_DEST = 12 - }; - - - //efects: - // color range is 0..255 - extern void lgd3d_set_chromakey(int red, int green, int blue); - - extern void lgd3d_set_dithering(int bOn); - extern int lgd3d_is_dithering_on(void); - - extern void lgd3d_set_antialiasing(int bOn); - extern int lgd3d_is_antialiasing_on(void); - - extern BOOL lgd3d_enable_specular(BOOL bUseIt); - - //fog - extern void lgd3d_set_fog_level(float fog_level); // 0.0 <= fog_level <= 1.0 - extern void lgd3d_set_fog_color(int r, int g, int b); // 0..255 - extern void lgd3d_set_fog_enable(BOOL enable); - extern void lgd3d_set_fog_density(float density); - extern int lgd3d_is_fog_on(void); - - // linear table fog - - // returns the previous setting - extern int lgd3d_use_linear_table_fog(int bUseIt); - - // fogginess: (end)____ - // / - // _____(start)/ - - // start and end are floats in "W-coordiantes", that is, in the [ z_near , z_far ]. - extern void lgd3d_set_fog_start_end(float fStart, float fEnd); //please, check that z_near <= fStart < fEnd <= z_far - - // set the distance at which we should have full fog (results vary for different video cards) - extern void lgd3d_set_linear_fog_distance(float fDistance); //please, check that fStart <= fDistance <= fEnd - - //Textures: - - extern void lgd3d_set_texture_level(int n); - extern void lgd3d_get_texblending_modes(ulong* pulLevel0Mode, ulong* pulLevel1Mode); - - //texture manager -#define lgd3d_set_texture(bm) \ -do if (g_tmgr) g_tmgr->set_texture(bm); while (0) - -#define lgd3d_load_texture(bm) \ -do if (g_tmgr) g_tmgr->load_texture(bm); while (0) - -#define lgd3d_unload_texture(bm) \ -do if (g_tmgr) g_tmgr->unload_texture(bm); while (0) - -// procedural textures - extern void lgd3d_hack_light(r3s_point* p, float r); - extern void lgd3d_hack_light_extra(r3s_point* p, float r, grs_bitmap* bm); - - // texture wrapping - // TRUE == wrap the texture (texture is a torus), - // FALSE == clamp the texture (texture is a closed rectangle) - extern BOOL lgd3d_get_texture_wrapping(DWORD dwLevel); - extern BOOL lgd3d_set_texture_wrapping(DWORD dwLevel, BOOL bSetSmooth); - - - // palettes - extern void lgd3d_set_pal(uint start, uint n, uchar* pal); - extern void lgd3d_set_pal_slot(uint start, uint n, uchar* pal, int slot); - extern void lgd3d_set_pal_slot_flags(uint start, uint n, uchar* pal, int slot, int flags); - - extern void lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask* bitmask); - extern void lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask* bitmask); - extern void lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask* bitmask); - - extern void lgd3d_set_texture_clut(uchar* clut); - extern uchar* lgd3d_set_clut(uchar* clut); - - extern void lgd3d_disable_palette(void); - extern void lgd3d_enable_palette(void); - - extern void lgd3d_set_alpha_pal(ushort* pal); - - - extern void lgd3d_set_offsets(int x, int y); - extern void lgd3d_get_offsets(int* x, int* y); - - - - // drawing: - - extern int lgd3d_draw_point(r3s_point* p); - extern void lgd3d_draw_line(r3s_point* p0, r3s_point* p1); - - - //Poligon Drowing states - //NOTE: for now it does *NOT* affect indexed and multytextured polies - - typedef enum ePolyMode { - kLgd3dPolyModeFillWTexture = 0x00000001L, - kLgd3dPolyModeFillWColor = 0x00000002L, - kLgd3dPolyModeDrawEdges = 0x00000004L, // use color - - kLgd3dPolyModeDefault = 0x00000001L, // normal, == kLgd3dPolyModeFillTexture - kLgd3dPolyModeWireframe = 0x00000004L, // == kLgd3dPolyModeDrawEdges - kLgd3dPolyModeOutlineTex = 0x00000005L, // == kLgd3dPolyModeFillWTexture + kLgd3dPolyModeDrawEdges - kLgd3dPolyModeOutlineColor = 0x00000006L, // == kLgd3dPolyModeFillWColor + kLgd3dPolyModeDrawEdges - - kLgd3dILLEGALPolyMode = 0x00000000L - } ePolyMode; - - extern BOOL lgd3d_set_poly_mode(ePolyMode eNewMode); - extern ePolyMode lgd3d_get_poly_mode(); - - - extern int lgd3d_trifan(int n, r3s_point** vpl); - extern int lgd3d_lit_trifan(int n, r3s_point** vpl); - extern int lgd3d_poly(int n, r3s_point** vpl); - extern int lgd3d_spoly(int n, r3s_point** vpl); - extern int lgd3d_g2upoly(int n, g2s_point** vpl); - extern int lgd3d_g2poly(int n, g2s_point** vpl); - extern int lgd3d_g2utrifan(int n, g2s_point** vpl); - extern int lgd3d_g2trifan(int n, g2s_point** vpl); - - - // r3d interface - typedef int (*tLgd3dDrawPolyFunc)(int n, r3s_phandle* pl); - - extern tLgd3dDrawPolyFunc lgd3d_draw_poly_func; - - extern void lgd3d_tmap_setup(grs_bitmap* bm); - extern void lgd3d_lit_tmap_setup(grs_bitmap* bm); - extern void lgd3d_rgblit_tmap_setup(grs_bitmap* bm); - extern void lgd3d_rgbalit_tmap_setup(grs_bitmap* bm); - extern void lgd3d_rgbafoglit_tmap_setup(grs_bitmap* bm); // rgba + fog - extern void lgd3d_diffspecular_tmap_setup(grs_bitmap* bm); // rgba + fog - extern void lgd3d_poly_setup(grs_bitmap* bm); - extern void lgd3d_spoly_setup(grs_bitmap* bm); - extern void lgd3d_rgb_poly_setup(grs_bitmap* bm); - extern void lgd3d_rgba_poly_setup(grs_bitmap* bm); - - - // indexed primitives: - - typedef int (*tLgd3dDrawPolyIndexedFunc)(int n, r3s_phandle* pl, r3ixs_info* info); - - extern tLgd3dDrawPolyIndexedFunc lgd3d_draw_poly_indexed_func; - - typedef void (*fp_release_IP)(void); - - extern fp_release_IP lgd3d_release_ip_func; - - extern int lgd3d_indexed_poly(int n, r3s_point** vpl, r3ixs_info* info); - extern int lgd3d_indexed_spoly(int n, r3s_point** vpl, r3ixs_info* info); - extern void lgd3d_rgblit_tmap_setup(grs_bitmap* bm); - extern int lgd3d_lit_indexed_trifan(int n, r3s_point** vpl, r3ixs_info* info); - - extern void lgd3d_release_indexed_primitives(void); - - - - /////////////////////////////////// - - // Multi texturing - - //used for single level texturing -#define LGD3DTB_MODULATE 0L //default -#define LGD3DTB_MODULATEALPHA 1L -#define LGD3DTB_BLENDDIFFUSE 2L - -#define LGD3DTB_NO_STATES 3L - - extern void lgd3d_set_texture_map_method(ulong flag); - - //2 levels texturing: -#define LGD3D_MULTITEXTURE_COLOR 0L //default -#define LGD3D_MULTITEXTURE_ALPHA 1L -#define LGD3D_MULTITEXTURE_BLEND_TEX_ALPHA 2L - -#define LGD3D_MULTITEXTURE_NO_STATES 3L - - extern void lgd3d_set_light_map_method(ulong flag); //from the above - - - // additional sets of texture coordinates are added - typedef struct { - float u, v; - } LGD3D_tex_coord; - - - - - extern int lgd3d_TrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - extern int lgd3d_LitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - extern int lgd3d_RGBlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - extern int lgd3d_RGBAlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - extern int lgd3d_RGBAFoglitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - extern int lgd3d_DiffuseSpecularMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc); - - extern int lgd3d_g2UTrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** vptc); - extern int lgd3d_g2TrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** vptc); - - - - // error codes:( the first argument of "lgd3d_get_error" ) -#define LGD3D_EC_OK 0L -#define LGD3D_EC_DD_KAPUT 1L -#define LGD3D_EC_RESTORE_ALL_SURFS 2L -#define LGD3D_EC_QUERY_D3D 3L -#define LGD3D_EC_GET_DD_CAPS 4L -#define LGD3D_EC_ZBUFF_ENUMERATION 5L -#define LGD3D_EC_CREATE_3D_DEVICE 6L -#define LGD3D_EC_CREATE_VIEWPORT 7L -#define LGD3D_EC_ADD_VIEWPORT 8L -#define LGD3D_EC_SET_VIEWPORT 9L -#define LGD3D_EC_SET_CURR_VP 10L -#define LGD3D_EC_CREATE_BK_MATERIAL 11L -#define LGD3D_EC_SET_BK_MATERIAL 12L -#define LGD3D_EC_GET_BK_MAT_HANDLE 13L -#define LGD3D_EC_GET_SURF_DESC 14L -#define LGD3D_EC_GET_3D_CAPS 15L -#define LGD3D_EC_VD_MPASS_MT 16L -#define LGD3D_EC_VD_S_DEFAULT 17L -#define LGD3D_EC_VD_SPASS_MT 18L -#define LGD3D_EC_VD_M_DEFAULT 19L -#define LGD3D_EC_VD_SPASS_BLENDDIFFUSE 20L -#define LGD3D_EC_VD_MPASS_BLENDDIFFUSE 21L - - - - BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult); - - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/libsrc/lgd3d/lgd3d.vcxproj b/libsrc/lgd3d/lgd3d.vcxproj index cbe655d..f70ad77 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj +++ b/libsrc/lgd3d/lgd3d.vcxproj @@ -1,4 +1,4 @@ - + @@ -18,6 +18,26 @@ x64 + + + + + + + + + + + + + + + + + + + + 16.0 Win32Proj @@ -150,29 +170,6 @@ true - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libsrc/lgd3d/lgd3d_g.cpp b/libsrc/lgd3d/lgd3d_g.cpp new file mode 100644 index 0000000..5914642 --- /dev/null +++ b/libsrc/lgd3d/lgd3d_g.cpp @@ -0,0 +1 @@ +void lgd3d_set_zlinear(int lin); \ No newline at end of file diff --git a/libsrc/lgd3d/render.c b/libsrc/lgd3d/render.c deleted file mode 100644 index cd064bd..0000000 --- a/libsrc/lgd3d/render.c +++ /dev/null @@ -1,1612 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/render.c 1.26 1998/07/06 15:32:20 buzzard Exp $ -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifdef MONO_SPEW -#define put_mono(c) \ -do { \ - uchar *p_mono = (uchar *)0xb0080; \ - *p_mono = c; \ -} while (0) -#else -#define put_mono(c) -#endif - -BOOL lgd3d_punt_buffer = FALSE; -static BOOL primitives_pending = FALSE; -static void flush_primitives(void); - -#define Flush() \ -do { \ - if (primitives_pending) \ - flush_primitives(); \ -} while (0) - - -typedef struct d3dval { - union { - D3DVALUE drVal; - DWORD dwVal; - }; -} d3dval; - -BOOL lgd3d_save_poly; -BOOL lgd3d_z_normal = TRUE; - -static d3dval fog_tabledensity; - -typedef struct cliprect { - float left, right, top, bot; -} cliprect; - -cliprect lgd3d_clip; - -#ifdef REALLY_EGREGIOUS_SPEW -#include -#define start(s) mprintf("tf%s",s) -#define end() mprint(".") -#else -#define start(s) -#define end() -#endif - -double z2d = 1.0; -double w2d = 1.0; -static double z_near = 1.0; -static double z_far = 200.0; -static double inv_z_far = 1.0 / 200.0; -static double z1 = 200.0 / 199.0; // z_far / (z_far - z_near) -static double z2 = 200.0 / 199.0; // z_near * z_far / (z_far - z_near) -static double zbias = 0.0; - -void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1) -{ - // TODO -} - -void lgd3d_set_z(float z) -{ - if (lgd3d_z_normal) - z2d = z; - else - z2d = z1 - (z2 / z); - - w2d = 1.0 / z; -} - -int lgd3d_is_zwrite_on(void) -{ - return 0; // TODO -} - -int lgd3d_is_zcompare_on(void) -{ - return 0; // TODO -} - -double lgd3d_set_zbias(double new_bias) -{ - double old_bias = zbias; - z1 += old_bias - new_bias; - zbias = new_bias; - return old_bias; -} - -void lgd3d_push_zbias_i(int nZBias) -{ - // TODO -} - -void lgd3d_pop_zbias(void) -{ - // TODO -} - - -void lgd3d_set_znearfar(double znear, double zfar) -{ - z_near = znear; - z_far = zfar; - inv_z_far = 1.0 / z_far; - z1 = (zfar / (zfar - znear)) - zbias; - z2 = znear * z1; -} - -static float x_offset = 0.0; -static float y_offset = 0.0; - -#define setxy(p, __sx, __sy) \ -do { \ - fix _sx = __sx + 0x8000; \ - fix _sy = __sy + 0x8000; \ - if (_sx > grd_gc.clip.f.right) \ - _sx = grd_gc.clip.f.right; \ - if (_sx < grd_gc.clip.f.left) \ - _sx = grd_gc.clip.f.left; \ - if (_sy > grd_gc.clip.f.bot) \ - _sy = grd_gc.clip.f.bot; \ - if (_sy < grd_gc.clip.f.top) \ - _sy = grd_gc.clip.f.top; \ - (p)->sx = fix_float(_sx)+x_offset; \ - (p)->sy = fix_float(_sy)+y_offset; \ -} while (0) - -#define setz(_dest, z, w) \ -do { \ - LPD3DTLVERTEX __dest = _dest; \ - if (zlinear) \ - __dest->sz = z2d; \ - else if (lgd3d_z_normal) \ - __dest->sz = z * inv_z_far; \ - else { \ - __dest->sz = z1 - z2 * w; \ - if (__dest->sz > 1.0) \ - __dest->sz = 1.0; \ - else if (__dest->sz < 0.0) \ - __dest->sz = 0.0; }\ - __dest->rhw = w; \ -} while (0) - -#define setxyz(dest, src) \ -do { \ - LPD3DTLVERTEX _dest = dest; \ - r3s_point *_src = src; \ - fix _sx = _src->grp.sx + 0x8000; \ - fix _sy = _src->grp.sy + 0x8000; \ - if (_sx > grd_gc.clip.f.right) \ - _sx = grd_gc.clip.f.right; \ - if (_sx < grd_gc.clip.f.left) \ - _sx = grd_gc.clip.f.left; \ - if (_sy > grd_gc.clip.f.bot) \ - _sy = grd_gc.clip.f.bot; \ - if (_sy < grd_gc.clip.f.top) \ - _sy = grd_gc.clip.f.top; \ - _dest->sx = fix_float(_sx)+x_offset; \ - _dest->sy = fix_float(_sy)+y_offset; \ - setz(_dest, _src->p.z, _src->grp.w); \ -} while (0) - -void lgd3d_set_offsets(int x, int y) -{ - x_offset = x; - y_offset = y; -} - -// -// Macros for internal use -// - -#define make_scolor(pColor, c0, intensity) \ -do { \ - ulong __c0 = (c0); \ - float __i = (intensity); \ - *(pColor) = ((ulong )((__c0 & 0xff) * __i)) + \ - (((ulong )(((__c0 >> 8) & 0xff) * __i)) << 8) + \ - (((ulong )(((__c0 >> 16) & 0xff) * __i)) << 16) + \ - (__c0 & 0xff000000); \ -} while (0) - -static BOOL lgd3d_blend = FALSE; -static BOOL lgd3d_trans = BMF_TRANS; -static int lgd3d_alpha = 255; - -void lgd3d_set_alpha(float alpha) -{ - lgd3d_alpha = alpha * 255; - - if (lgd3d_alpha > 255) - lgd3d_alpha = 255; - if (lgd3d_alpha < 0) - lgd3d_alpha = 0; -} - -static BOOL use_palette = TRUE; - -void lgd3d_disable_palette(void) -{ - use_palette = FALSE; -} - -void lgd3d_enable_palette(void) -{ - use_palette = TRUE; -} - -static D3DCOLOR get_color(void) -{ - D3DCOLOR color; - if (use_palette) { - int index = grd_gc.fcolor&0xff; - - switch (grd_gc.fill_type) { - default: - Warning(("lgd3d: unsupported fill type: %i\n", grd_gc.fill_type)); - case FILL_NORM: - break; - case FILL_CLUT: - index = ((uchar *)grd_gc.fill_parm)[index]; - break; - case FILL_SOLID: - index = grd_gc.fill_parm; - } - - // This hack effectively simulates the lighting table - // hacks done in flight2 - if (lgd3d_clut != NULL) - index = lgd3d_clut[index]; - - index *= 3; - color = RGBA_MAKE(grd_pal[index],grd_pal[index+1],grd_pal[index+2],lgd3d_alpha); - } else { - switch (grd_gc.fill_type) { - default: - Warning(("lgd3d: unsupported fill type: %i\n", grd_gc.fill_type)); - case FILL_NORM: - color = grd_gc.fcolor; - break; - case FILL_SOLID: - color = grd_gc.fill_parm; - } - color = (color&0xffffff) + (lgd3d_alpha<<24); - } - return color; -} - -#define d3d_device lpd3dDevice - -#ifdef USE_D3D2_API - -#ifndef SHIP -#define SetRenderState(name, data) \ -do { \ - HRESULT hres = d3d_device->lpVtbl->SetRenderState(d3d_device, name, data); \ - AssertMsg1(!FAILED(hres), "SetRenderState failed: error %i", hres&0xffff); \ -} while (0) -#define SetLightState(name, data) \ -do { \ - HRESULT hres = d3d_device->lpVtbl->SetLightState(d3d_device, name, data); \ - AssertMsg1(!FAILED(hres), "SetLightState failed: error %i", hres&0xffff); \ -} while (0) -#else -#define SetRenderState(name, data) \ - d3d_device->lpVtbl->SetRenderState(d3d_device, name, data) -#define SetLightState(name, data) \ - d3d_device->lpVtbl->SetLightState(d3d_device, name, data) -#endif - -#else -#define SetRenderState(name,data) -#define SetLightState(name,data) -#endif - -static D3DCOLOR fog_specular = (D3DCOLOR )D3DRGBA(0.0, 0.0, 0.0, 1.0); - -void lgd3d_set_fog_level(float fl) -{ - fog_specular = D3DRGBA(0.0, 0.0, 0.0, 1.0 - fl); -} - -static D3DCOLOR fog_color = D3DRGB(0.8, 0.0, 0.0); - -void lgd3d_set_fog_color(int r, int g, int b) -{ - if (r > 255) - r = 255; - else if (r <0) - r = 0; - if (g > 255) - g = 255; - else if (g <0) - g = 0; - if (b > 255) - b = 255; - else if (b <0) - b = 0; - - fog_color = RGB_MAKE(r, g, b); - put_mono('a'); - SetRenderState(D3DRENDERSTATE_FOGCOLOR, fog_color); - put_mono('.'); -} - -#ifndef USE_D3D2_API -static void *get_exebuf_data(int index, int *size) -{ - HRESULT hres; - D3DEXECUTEBUFFERDESC d3dExeBufDesc; - LPD3DIEXECUTEBUFFER ExeBuf; - - ExeBuf = index ? lpd3dExecuteBuffer2:lpd3dExecuteBuffer; - ZeroMemory(&d3dExeBufDesc, sizeof(d3dExeBufDesc)); - d3dExeBufDesc.dwSize = sizeof(d3dExeBufDesc); - hres = ExeBuf->lpVtbl->Lock(ExeBuf, &d3dExeBufDesc); - *size = d3dExeBufDesc.dwBufferSize; - return d3dExeBufDesc.lpData; -} - -static void execute(int index, int vertex_count, int inst_offset, int inst_length) -{ - HRESULT hres; - D3DEXECUTEDATA d3dExecuteData; - LPD3DIEXECUTEBUFFER ExeBuf; - - ExeBuf = index ? lpd3dExecuteBuffer2:lpd3dExecuteBuffer; - hres = ExeBuf->lpVtbl->Unlock(ExeBuf); - - ZeroMemory(&d3dExecuteData, sizeof(d3dExecuteData)); - d3dExecuteData.dwSize = sizeof(d3dExecuteData); - d3dExecuteData.dwVertexCount = vertex_count; - d3dExecuteData.dwInstructionOffset = inst_offset; - d3dExecuteData.dwInstructionLength = inst_length; - - hres = ExeBuf->lpVtbl->SetExecuteData(ExeBuf, &d3dExecuteData); - AssertMsg1(!FAILED(hres), "SetExecuteData failed: error %i", hres&0xffff); - - hres = d3d_device->lpVtbl->Execute(lpd3dDevice, ExeBuf, - lpd3dViewport, D3DEXECUTE_UNCLIPPED); - AssertMsg1(!FAILED(hres), "Execute failed: error %i", hres&0xffff); -} -#endif - -static void SetTransparent(int flags); - -static BOOL zbuffer; -static BOOL zwrite; -static BOOL zcompare; - -void lgd3d_set_zcompare(BOOL val) -{ - if (zcompare == val) - return; - - put_mono('b'); - Flush(); - SetRenderState(D3DRENDERSTATE_ZFUNC, val?D3DCMP_LESSEQUAL:D3DCMP_ALWAYS); - put_mono('.'); - zcompare = val; -} - -void lgd3d_set_zwrite(BOOL val) -{ - if (zwrite == val) - return; - - put_mono('c'); - Flush(); - SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, zwrite=val); - put_mono('.'); -} - -void lgd3d_zclear(void) -{ - Warning(("zclear not yet implemented")); -} - -void lgd3d_blend_normal(void) -{ - Flush(); - SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); -} - -void lgd3d_blend_multiply(int blend_mode) -{ - static int table[4] = { - D3DBLEND_ZERO, - D3DBLEND_ONE, - D3DBLEND_SRCCOLOR, - D3DBLEND_DESTCOLOR - }; - int state1,state2; - state1 = table[blend_mode & 3]; - state2 = table[(blend_mode >> 2) & 3]; - - Flush(); - SetRenderState(D3DRENDERSTATE_SRCBLEND, state1); - SetRenderState(D3DRENDERSTATE_DESTBLEND, state2); -} - -// -// -// Library internal functions -// -// - -void lgd3d_render_init(lgd3ds_device_info *info) -{ - zbuffer = info->flags&LGD3DF_ZBUFFER; - fog_tabledensity.drVal = 0.025; - -#ifdef USE_D3D2_API - put_mono('d'); - SetRenderState(D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - SetRenderState(D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD); - SetRenderState(D3DRENDERSTATE_SPECULARENABLE, FALSE); - SetRenderState(D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE); - SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - SetRenderState(D3DRENDERSTATE_WRAPU, FALSE); - SetRenderState(D3DRENDERSTATE_WRAPV, FALSE); - SetRenderState(D3DRENDERSTATE_ZENABLE, (info->flags & LGD3DF_ZBUFFER) ? TRUE : FALSE); - SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, zwrite = FALSE); - SetRenderState(D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS); - zcompare = FALSE; - - // disable fogtable on @#$! powerVR! - if (info->device_desc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) - info->device_desc->dpcTriCaps.dwRasterCaps &= ~D3DPRASTERCAPS_FOGTABLE; - if (info->device_desc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) - { // Setup table fog - SetRenderState(D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_EXP); - SetRenderState(D3DRENDERSTATE_FOGTABLEDENSITY, fog_tabledensity.dwVal); - SetLightState(D3DLIGHTSTATE_FOGMODE, D3DFOG_EXP); - SetLightState(D3DLIGHTSTATE_FOGDENSITY, fog_tabledensity.dwVal); - } else - { // use vertex fog - SetRenderState(D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE); - SetLightState(D3DLIGHTSTATE_FOGMODE, D3DFOG_NONE); - } - - put_mono('.'); -#else -{ - void *data, *start; - int length, size; - - start = data = get_exebuf_data(0, &size); - - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_FOGENABLE, TRUE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_FOGCOLOR, fog_color, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_EXP, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_FOGTABLEDENSITY, fog_tabledensity.dwVal, data); - - OP_STATE_LIGHT(1, data); - STATE_DATA(D3DLIGHTSTATE_FOGMODE, D3DFOG_EXP, data); - OP_STATE_LIGHT(1, data); - STATE_DATA(D3DLIGHTSTATE_FOGDENSITY, fog_tabledensity.dwVal, data); - - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_SPECULARENABLE, TRUE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_COLORKEYENABLE, FALSE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_BLENDENABLE, FALSE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE, data); - OP_STATE_RENDER(1, data); -// STATE_DATA(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA, data); - STATE_DATA(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE, data); - OP_STATE_RENDER(1, data); -// STATE_DATA(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA, data); - STATE_DATA(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_WRAPU, FALSE, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_WRAPV, FALSE, data); - OP_EXIT(data); - - length = (char *)data - (char *)start; - AssertMsg(length < size, "Yikes! out of exebuf space!"); - - memset(data, 0, size-length); - - execute(0, 0, 0, length); -} -#endif - - // force init - lgd3d_trans = BMF_TRANS; - SetTransparent(0); -} - -void lgd3d_set_fog_enable(BOOL enable) -{ - put_mono('e'); - Flush(); - SetRenderState(D3DRENDERSTATE_FOGENABLE, enable); - put_mono('.'); -} - - -// -// Called once per frame from lgd3d_start_frame() to initialize render state. -// - -int num_polys, tri_index, num_poly_verts, num_points; - -void lgd3d_render_start_frame(void) -{ - num_points = num_polys = tri_index = num_poly_verts = 0; - lgd3d_clip.left = fix_float(grd_gc.clip.f.left)+x_offset; - lgd3d_clip.right = fix_float(grd_gc.clip.f.right)+x_offset; - lgd3d_clip.top = fix_float(grd_gc.clip.f.top)+y_offset; - lgd3d_clip.bot = fix_float(grd_gc.clip.f.bot)+y_offset; - - lgd3d_set_fog_enable(FALSE); - lgd3d_set_fog_level(0.0); -} - -void lgd3d_render_end_frame(void) -{ - Flush(); -} - -void lgd3d_set_fog_density(float density) -{ - fog_tabledensity.drVal = density * z_far; - - put_mono('f'); - Flush(); - SetRenderState(D3DRENDERSTATE_FOGTABLEDENSITY, fog_tabledensity.dwVal); - SetLightState(D3DLIGHTSTATE_FOGDENSITY, fog_tabledensity.dwVal); - put_mono('.'); -} - -int lgd3d_is_fog_on(void) -{ - return 0; // TODO -} - -int lgd3d_use_linear_table_fog(int bUseIt) -{ - // TODO - return 0; -} - -void lgd3d_set_linear_fog_distance(float fDistance) -{ - // TODO -} - -void lgd3d_set_texture_level(int n) -{ - // TODO -} - -// -// Interface to texture manager -// - - -// can't bilinear filter and colorkey at the same time -// (actually, we can; it just looks really stupid) -static void SetTransparent(int trans) -{ - DWORD filter; - - if (lgd3d_trans == (int )trans) - return; - - lgd3d_trans = trans; - filter = (trans&BMF_TRANS) ? D3DFILTER_NEAREST : D3DFILTER_LINEAR; - -#ifdef USE_D3D2_API - put_mono('g'); - Flush(); - SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, trans&BMF_TRANS); - SetRenderState(D3DRENDERSTATE_BLENDENABLE, trans&BMF_TRANS); - SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, trans||lgd3d_blend); - SetRenderState(D3DRENDERSTATE_TEXTUREMAG, filter); - SetRenderState(D3DRENDERSTATE_TEXTUREMIN, filter); - put_mono('.'); -#else - void *data, *start; - int size, length; - - data = start = get_exebuf_data(0, &size); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_TEXTUREMAG, filter, data); - OP_STATE_RENDER(1, data); - STATE_DATA(D3DRENDERSTATE_TEXTUREMIN, filter, data); - OP_EXIT(data); - - length = (char *)data - (char *)start; - - memset(data, 0, size - length); - - execute(0, 0, 0, length); -#endif -} - - -static int next_id=TDRV_ID_INVALID; - -#define SetPoly() next_id = TDRV_ID_SOLID - -void SetTextureId(int n) -{ - next_id = n; -} - -// used when a texture is released to make sure state is reset - -static int tex_id=TDRV_ID_INVALID; - -static void doPolySetup(int n) -{ -#ifdef USE_D3D2_API - int trans; - - put_mono('h'); - Flush(); - if (n==TDRV_ID_SOLID) { - put_mono('1'); - SetLightState(D3DLIGHTSTATE_MATERIAL, hPolyMaterial); - put_mono('2'); - SetRenderState(D3DRENDERSTATE_TEXTUREHANDLE, 0); - trans = 0; - } else { - AssertMsg1( (n>=0)&&(nflags & (BMF_TRANS|BMF_TLUC); - } - put_mono('5'); - SetTransparent(trans); - put_mono('.'); -#endif -} - -void UnsetTextureId(int n) -{ - extern void SynchD3D(void); - - if (n==tex_id) { - doPolySetup(tex_id=TDRV_ID_SOLID); - SynchD3D(); // flush it, cause the old handle's about to be released! - } -} - -BOOL lgd3d_punt_d3d = FALSE; - -static void prim_setup(void) -{ - if (lgd3d_punt_d3d) - return; - - if (next_id == TDRV_ID_CALLBACK) { - Flush(); - g_tmgr->set_texture_callback(); - } - - if (tex_id != next_id) - doPolySetup(tex_id = next_id); -} - -static void do_points(int n, LPD3DTLVERTEX vlist) -{ - HRESULT hres; - - if (lgd3d_punt_d3d) - return; - - prim_setup(); - - put_mono('i'); - hres = d3d_device->lpVtbl->DrawPrimitive(d3d_device, D3DPT_POINTLIST, D3DVT_TLVERTEX, - (LPVOID)vlist, n, D3DDP_DONOTCLIP); - put_mono('.'); - - AssertMsg1(!FAILED(hres), "DrawPrimitive failed: error %i", hres&0xffff); -} - -// -// guts of all polygon drawing routines -// - -static void do_trifan(int n, LPD3DTLVERTEX vlist) -{ - HRESULT hres; - AssertMsg(next_id>TDRV_ID_INVALID, "Current Texture is invalid!"); - - if (lgd3d_punt_d3d) - return; - - prim_setup(); - - put_mono('j'); - hres = d3d_device->lpVtbl->DrawPrimitive(d3d_device, D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, - (LPVOID)vlist, n, D3DDP_DONOTCLIP); - put_mono('.'); - - AssertMsg1(!FAILED(hres), "DrawPrimitive failed: error %i", hres&0xffff); -} - -#define MAX_POLY_VERTS 50 -D3DTLVERTEX poly_vertex_buffer[MAX_POLY_VERTS]; -ushort tri_index_buffer[3*MAX_POLY_VERTS]; - -static void flush_polys(void) -{ - if (!num_polys) - return; - - if (!lgd3d_punt_d3d) { - HRESULT hres; - if (num_polys==1) - hres = d3d_device->lpVtbl->DrawPrimitive(d3d_device, D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, - (LPVOID)poly_vertex_buffer, num_poly_verts, D3DDP_DONOTCLIP); - else - hres = d3d_device->lpVtbl->DrawIndexedPrimitive(d3d_device, D3DPT_TRIANGLELIST, D3DVT_TLVERTEX, - (LPVOID)poly_vertex_buffer, num_poly_verts, tri_index_buffer, tri_index, D3DDP_DONOTCLIP); - AssertMsg1(!FAILED(hres), "DrawPrimitive failed: error %i", hres&0xffff); - } - - num_polys = tri_index = num_poly_verts = 0; -} - -#define MAX_POINTS 50 -D3DTLVERTEX point_buffer[MAX_POINTS]; - -static void flush_points(void) -{ - if (!num_points) - return; - - if (!lgd3d_punt_d3d) { - HRESULT hres; - hres = d3d_device->lpVtbl->DrawPrimitive(d3d_device, D3DPT_POINTLIST, D3DVT_TLVERTEX, - (LPVOID)point_buffer, num_points, D3DDP_DONOTCLIP); - AssertMsg1(!FAILED(hres), "DrawPrimitive failed: error %i", hres&0xffff); - } - num_points = 0; -} - -static void flush_primitives(void) -{ - flush_points(); - flush_polys(); - primitives_pending = FALSE; -} - - -static LPD3DTLVERTEX PolyMalloc(int n) -{ - LPD3DTLVERTEX retval; - int i; - - if (lgd3d_punt_buffer) - return (LPD3DTLVERTEX )temp_malloc(n*sizeof(D3DTLVERTEX)); - - prim_setup(); - - if (num_poly_verts + n > MAX_POLY_VERTS) - flush_polys(); - - AssertMsg(num_poly_verts + n <= MAX_POLY_VERTS, "PolyMalloc(): poly too large!"); - - retval = &poly_vertex_buffer[num_poly_verts]; - - // Do the fan index thing... - tri_index_buffer[tri_index] = num_poly_verts; - tri_index_buffer[tri_index+1] = num_poly_verts+1; - tri_index_buffer[tri_index+2] = num_poly_verts+2; - tri_index+=3; - for (i=3; i MAX_POINTS) - flush_points(); - - AssertMsg(num_points + n <= MAX_POINTS, "PointMalloc(): too many points!"); - - retval = &point_buffer[num_points]; - - num_points += n; - primitives_pending = TRUE; - - return retval; -} - -static void PointFree(int n, LPD3DTLVERTEX vlist) -{ - if (!lgd3d_punt_buffer) - return; - - do_points(n, vlist); - temp_free(vlist); -} - -static BOOL linear = FALSE; -void lgd3d_set_linear(BOOL lin) -{ - linear = lin; -} - -static BOOL zlinear = FALSE; -void lgd3d_set_zlinear(BOOL lin) -{ - zlinear = lin; -} - -void lgd3d_set_blend(BOOL blend_enable) -{ - put_mono('k'); - if (lgd3d_blend != blend_enable) { - lgd3d_blend = blend_enable; - Flush(); - SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, blend_enable||lgd3d_trans); - } - put_mono('.'); -} - -void lgd3d_draw_line(r3s_point *p0, r3s_point *p1) -{ - fix x10, y10; - LPD3DTLVERTEX vlist; - int i, save_id; - D3DCOLOR c=get_color(); - fix temp, left, right, top, bot; - float x0, x1, y0, y1; - - left = grd_gc.clip.f.left; - right = grd_gc.clip.f.right; - top = grd_gc.clip.f.top; - bot = grd_gc.clip.f.bot; - - if (bot - top < FIX_UNIT) - return; - - if (right - left < FIX_UNIT) - return; - - save_id = next_id; - - SetPoly(); - - vlist = PolyMalloc(4); - - for (i=0; i<4; i++) { - vlist[i].color = c; - vlist[i].specular = fog_specular; - setz(&vlist[i], p0->p.z, p0->grp.w); - vlist[i].tu = vlist[i].tv = 0.0; - } - - x10 = p1->grp.sx - p0->grp.sx; - y10 = p1->grp.sy - p0->grp.sy; - if (x10 < 0) x10 = -x10; - if (y10 < 0) y10 = -y10; - - if (y10 > x10) { - left += 0x8000; - right -= 0x8000; - - if (p0->grp.sy > p1->grp.sy) { - r3s_point *tmp = p0; - p0 = p1; - p1 = tmp; - } - } else { - top += 0x8000; - bot -= 0x8000; - if (p0->grp.sx > p1->grp.sx) { - r3s_point *tmp = p0; - p0 = p1; - p1 = tmp; - } - } - - temp = p0->grp.sx + 0x8000; - if (temp < left) - temp = left; - if (temp > right) - temp = right; - x0 = fix_float(temp)+x_offset; - - temp = p1->grp.sx + 0x8000; - if (temp < left) - temp = left; - if (temp > right) - temp = right; - x1 = fix_float(temp)+x_offset; - - temp = p0->grp.sy + 0x8000; - if (temp < top) - temp = top; - if (temp > bot) - temp = bot; - y0 = fix_float(temp)+y_offset; - - temp = p1->grp.sy + 0x8000; - if (temp < top) - temp = top; - if (temp > bot) - temp = bot; - y1 = fix_float(temp)+y_offset; - - if (y10 > x10) { - vlist[0].sx = x0 - 0.5; - vlist[1].sx = x0 + 0.5; - vlist[2].sx = x1 + 0.5; - vlist[3].sx = x1 - 0.5; - vlist[0].sy = y0; - vlist[1].sy = y0; - vlist[2].sy = y1; - vlist[3].sy = y1; - } else { - vlist[0].sy = y0 + 0.5; - vlist[1].sy = y0 - 0.5; - vlist[2].sy = y1 - 0.5; - vlist[3].sy = y1 + 0.5; - vlist[0].sx = x0; - vlist[1].sx = x0; - vlist[2].sx = x1; - vlist[3].sx = x1; - } - - PolyFree(4, vlist); - next_id = save_id; -} - -static grs_bitmap *hack_light_bm = NULL; -static ushort hack_light_alpha_pal[16] = -{ - 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, 0x7fff, - 0x8fff, 0x9fff, 0xafff, 0xbfff, 0xcfff, 0xdfff, 0xefff, 0xffff, -}; - -void lgd3d_render_shutdown(void) -{ - if (hack_light_bm != NULL) { - lgd3d_unload_texture(hack_light_bm); - gr_free(hack_light_bm); - hack_light_bm = NULL; - } -} - - -static void init_hack_light_bm(void) -{ - uchar *bits; - int i,j; - - hack_light_bm = gr_alloc_bitmap(BMT_FLAT8, BMF_TLUC, 32, 32); - bits = hack_light_bm->bits; - for (i=0; i<32; i++) { - for (j=0; j<32; j++) { - float alpha = 8.0 * 16.0 / ((i-15.5)*(i-15.5) + (j-15.5)*(j-15.5)); - uchar val; - if (alpha > 15.0) - val = 15; - else { - val = alpha; - } - bits[j] = val; - } - bits += 32; - } -} - - -static void do_quad_light(r3s_point *p, float r, grs_bitmap *bm) -{ - float x = fix_float(p->grp.sx)+x_offset; - float y = fix_float(p->grp.sy)+y_offset; - float x_right, x_left, y_top, y_bot; - float u_right, u_left, v_top, v_bot; - LPD3DTLVERTEX vl; - D3DCOLOR c; - - if ((x+r < lgd3d_clip.left) || (x-r > lgd3d_clip.right) || - (y+r < lgd3d_clip.top) || (y-r > lgd3d_clip.bot)) - return; - - c = get_color()|0xff000000; - - gr_set_fill_type(FILL_BLEND); - lgd3d_set_alpha_pal(hack_light_alpha_pal); - lgd3d_set_texture(bm); - - vl = PolyMalloc(4); - x_right = x+r; x_left = x-r; - u_left = 0; u_right = 1.0; - if (x_left < lgd3d_clip.left) { - u_left = (lgd3d_clip.left - x_left) / (2*r); - x_left = lgd3d_clip.left; - } - if (x_right > lgd3d_clip.right) { - u_right = u_left + (u_right - u_left)*(lgd3d_clip.right - x_left) / (x_right - x_left); - x_right = lgd3d_clip.right; - } - y_bot = y+r; y_top = y-r; - v_top = 0; v_bot = 1.0; - if (y_top < lgd3d_clip.top) { - v_top = (lgd3d_clip.top - y_top) / (2*r); - y_top = lgd3d_clip.top; - } - if (y_bot > lgd3d_clip.bot) { - v_bot = v_top + (1.0 - v_top)*(lgd3d_clip.bot - y_top) / (y_bot - y_top); - y_bot = lgd3d_clip.bot; - } - - vl[0].tu = u_left; - vl[0].tv = v_top; - vl[0].sx = x_left; - vl[0].sy = y_top; - vl[0].color = c; - vl[0].specular = fog_specular; - setz(&vl[0], p->p.z, p->grp.w); - vl[1].tu = u_right; - vl[1].tv = v_top; - vl[1].sx = x_right; - vl[1].sy = y_top; - vl[1].color = c; - vl[1].specular = fog_specular; - setz(&vl[1], p->p.z, p->grp.w); - vl[2].tu = u_right; - vl[2].tv = v_bot; - vl[2].sx = x_right; - vl[2].sy = y_bot; - vl[2].color = c; - vl[2].specular = fog_specular; - setz(&vl[2], p->p.z, p->grp.w); - vl[3].tu = u_left; - vl[3].tv = v_bot; - vl[3].sx = x_left; - vl[3].sy = y_bot; - vl[3].color = c; - vl[3].specular = fog_specular; - setz(&vl[3], p->p.z, p->grp.w); - - PolyFree(4, vl); - - gr_set_fill_type(FILL_NORM); -} - -int lgd3d_draw_point(r3s_point *p) -{ - fix sx = p->grp.sx + 0x8000; - fix sy = p->grp.sy + 0x8000; - LPD3DTLVERTEX vp; - D3DCOLOR c=get_color()|0xff000000; - int save_id; - - if ((sx > grd_gc.clip.f.right) || (sx < grd_gc.clip.f.left) || - (sy > grd_gc.clip.f.bot) || (sy < grd_gc.clip.f.top)) - return CLIP_ALL; - - save_id = next_id; - SetPoly(); - - vp = PointMalloc(1); - vp->sx = fix_float(sx) + x_offset; - vp->sy = fix_float(sy) + y_offset; - vp->color = c; - vp->specular = fog_specular; - setz(vp, p->p.z, p->grp.w); - - PointFree(1, vp); - - next_id = save_id; - return CLIP_NONE; -} - -int lgd3d_draw_point_alpha(r3s_point *p, float alpha) -{ - fix sx = p->grp.sx + 0x8000; - fix sy = p->grp.sy + 0x8000; - LPD3DTLVERTEX vp; - D3DCOLOR c=get_color()&0xffffff; - int save_id; - - if ((sx > grd_gc.clip.f.right) || (sx < grd_gc.clip.f.left) || - (sy > grd_gc.clip.f.bot) || (sy < grd_gc.clip.f.top)) - return CLIP_ALL; - - c += ((int) (255 * alpha)) << 24; - - save_id = next_id; - SetPoly(); - - vp = PointMalloc(1); - vp->sx = fix_float(sx) + x_offset; - vp->sy = fix_float(sy) + y_offset; - vp->color = c; - vp->specular = fog_specular; - setz(vp, p->p.z, p->grp.w); - - PointFree(1, vp); - - next_id = save_id; - return CLIP_NONE; -} - - -void lgd3d_hack_light(r3s_point *p, float r) -{ - if (r <= 1.0) { - lgd3d_draw_point(p); - } else { - if (hack_light_bm == NULL) - init_hack_light_bm(); - - do_quad_light(p,r, hack_light_bm); - } -} - -void lgd3d_hack_light_extra(r3s_point *p, float r, grs_bitmap *bm) -{ - if (r <= 1.0) { - float alpha = r*r; - // scale by the overall alpha for this guy: what a hack: - alpha *= bm->bits[bm->row*(bm->h>>1) + (bm->w>>1)] / 15.0; - lgd3d_draw_point(p); - } else - do_quad_light(p,r,bm); -} - -// -// r3d-like api -// - -static int lgd3d_poly(int n, r3s_point **ppl) -{ - LPD3DTLVERTEX vlist; - int j; - D3DCOLOR c = get_color(); - - vlist = PolyMalloc(n); - for (j=0; jgrp.i; - if (i>1.0) i = 1.0; - make_scolor(&vlist[j].color, c0, i); - vlist[j].specular = fog_specular; - setxyz(&vlist[j], ppl[j]); - } - - PolyFree(n, vlist); - - return CLIP_NONE; -} - -static int lgd3d_rgb_poly(int n, r3s_point **ppl) -{ - LPD3DTLVERTEX vlist; - int j; - D3DCOLOR c0 = get_color(); - int rc,gc,bc; - rc = (c0 >> 16) & 255; - gc = (c0 >> 8) & 255; - bc = (c0 >> 0) & 255; - - start("l"); - vlist = PolyMalloc(n); - for (j=0; jgrp; - r = rc*g2p->i; if (r>255) r = 255; - g = gc*g2p->h; if (g>255) g = 255; - b = bc*g2p->d; if (b>255) b = 255; - vlist[j].color = RGBA_MAKE(r,g,b,lgd3d_alpha); - vlist[j].specular = fog_specular; - setxyz(&vlist[j], ppl[j]); - } - - PolyFree(n, vlist); - - end(); - return CLIP_NONE; -} - -int lgd3d_lit_trifan(int n, r3s_point **ppl) -{ - LPD3DTLVERTEX vlist; - int j; - D3DCOLOR c0 = (lgd3d_alpha << 24) + 0xffffff; - - start("l"); - vlist = PolyMalloc(n); - for (j=0; jgrp.u; - v = ppl[j]->grp.v; - i = ppl[j]->grp.i; - if (i>1.0) i = 1.0; - vlist[j].tu = u; - vlist[j].tv = v; - make_scolor(&vlist[j].color, c0, i); - vlist[j].specular = fog_specular; - setxyz(&vlist[j], ppl[j]); - } - - PolyFree(n, vlist); - - end(); - return CLIP_NONE; -} - -static int lgd3d_rgblit_trifan(int n, r3s_point **ppl) -{ - LPD3DTLVERTEX vlist; - int j; - - start("l"); - vlist = PolyMalloc(n); - for (j=0; jgrp; - u = ppl[j]->grp.u; - v = ppl[j]->grp.v; - vlist[j].tu = u; - vlist[j].tv = v; - r = 255*g2p->i; if (r>255) r = 255; - g = 255*g2p->h; if (g>255) g = 255; - b = 255*g2p->d; if (b>255) b = 255; - vlist[j].color = RGBA_MAKE(r,g,b,lgd3d_alpha); - vlist[j].specular = fog_specular; - setxyz(&vlist[j], ppl[j]); - } - - PolyFree(n, vlist); - - end(); - return CLIP_NONE; -} - -int lgd3d_trifan(int n, r3s_point **ppl) -{ - LPD3DTLVERTEX vlist; - D3DCOLOR c0 = (lgd3d_alpha << 24) + 0xffffff; - int i; - - start("f"); - vlist = PolyMalloc(n); - - for (i=0; igrp.u; - v = ppl[i]->grp.v; - - vlist[i].tu = u; - vlist[i].tv = v; - setxyz(&vlist[i], ppl[i]); - vlist[i].color = c0; - vlist[i].specular = fog_specular; - } - - PolyFree(n, vlist); - - end(); - return CLIP_NONE; -} - -// -// actual r3d interface: setup functions + global function ptr -// - -int (*lgd3d_draw_poly_func)(int n, r3s_phandle *pl); - -void lgd3d_lit_tmap_setup(grs_bitmap *bm) -{ - g_tmgr->set_texture(bm); - lgd3d_draw_poly_func = lgd3d_lit_trifan; -} - -void lgd3d_tmap_setup(grs_bitmap *bm) -{ - g_tmgr->set_texture(bm); - lgd3d_draw_poly_func = lgd3d_trifan; -} - -void lgd3d_rgblit_tmap_setup(grs_bitmap *bm) -{ - g_tmgr->set_texture(bm); - lgd3d_draw_poly_func = lgd3d_rgblit_trifan; -} - -#pragma off(unreferenced) -void lgd3d_poly_setup(grs_bitmap *bm) -{ - SetPoly(); - lgd3d_draw_poly_func = lgd3d_poly; -} - -void lgd3d_spoly_setup(grs_bitmap *bm) -{ - SetPoly(); - lgd3d_draw_poly_func = lgd3d_spoly; -} - -void lgd3d_rgb_poly_setup(grs_bitmap *bm) -{ - SetPoly(); - lgd3d_draw_poly_func = lgd3d_rgb_poly; -} -#pragma on(unreferenced) - - -// -// g2 - like interface: take g2s_point handle lists -// - -int lgd3d_g2utrifan(int n, g2s_point **ppl) -{ - LPD3DTLVERTEX vlist; - D3DCOLOR c0 = (lgd3d_alpha << 24) + 0xffffff; - int i; - - vlist = PolyMalloc(n); - for (i=0; ii; - setxy(&vlist[i], ppl[i]->sx, ppl[i]->sy); - vlist[i].sz = z2d; - vlist[i].rhw = w2d; - make_scolor(&vlist[i].color, c0, j); - vlist[i].specular = fog_specular; - vlist[i].tu = ppl[i]->u; - vlist[i].tv = ppl[i]->v; - } - - PolyFree(n, vlist); - - return CLIP_NONE; -} - - -int lgd3d_g2upoly(int n, g2s_point **ppl) -{ - LPD3DTLVERTEX vlist; - int j; - D3DCOLOR c=get_color(); - - vlist = PolyMalloc(n); - for (j=0; jsx, ppl[j]->sy); - vlist[j].sz = z2d; - vlist[j].rhw = w2d; -// vlist[j].tu = vlist[j].tv = 0.0; - } - - PolyFree(n, vlist); - - return CLIP_NONE; -} - - -int lgd3d_g2poly(int n, g2s_point **ppl) -{ - int m, code; - g2s_point **cpl=NULL; - - m = g2_clip_poly(n, G2C_CLIP_NONE, ppl, &cpl); - - if (m<3) { - code = CLIP_ALL; - } else { - lgd3d_g2upoly(m, cpl); - code = CLIP_NONE; - } - if ((cpl!=NULL)&&(cpl!=ppl)) - temp_free(cpl); - - return code; -} - -int lgd3d_g2trifan(int n, g2s_point **ppl) -{ - int m, code; - g2s_point **cpl=NULL; - - m = g2_clip_poly(n, G2C_CLIP_UVI, ppl, &cpl); - - if (m<3) { - code = CLIP_ALL; - } else { - lgd3d_g2utrifan(m, cpl); - code = CLIP_NONE; - } - if ((cpl!=NULL)&&(cpl!=ppl)) - temp_free(cpl); - - return code; -} - -void lgd3d_clear(int c) -{ - LPD3DTLVERTEX vlist; - float x0, y0, x1, y1; - int i, save_id; - int fc_save = gr_get_fcolor(); - - save_id = next_id; - SetPoly(); - - vlist = PolyMalloc(4); - - gr_set_fcolor(c); - - c = get_color(); - - gr_set_fcolor(fc_save); - - x0 = fix_float(grd_gc.clip.f.left) + x_offset; - x1 = fix_float(grd_gc.clip.f.right) + x_offset; - y0 = fix_float(grd_gc.clip.f.top) + y_offset; - y1 = fix_float(grd_gc.clip.f.bot) + y_offset; - - for (i=0; i<4; i++) - { - vlist[i].sz = z2d; - vlist[i].rhw = w2d; - vlist[i].color = c; - vlist[i].specular = fog_specular; - } - - vlist[0].sx = x0; - vlist[0].sy = y0; - vlist[1].sx = x1; - vlist[1].sy = y0; - vlist[2].sx = x1; - vlist[2].sy = y1; - vlist[3].sx = x0; - vlist[3].sy = y1; - - PolyFree(4, vlist); - - next_id = save_id; -} - -#ifdef OLD_AND_UNSUPPORTED -extern int lgd3d_clip_poly(int n, LPD3DTLVERTEX *vpl, LPD3DTLVERTEX **cvpl); - -static void clip_poly_array(int n, LPD3DTLVERTEX vlist) -{ - LPD3DTLVERTEX *vpl; - LPD3DTLVERTEX *cvpl=NULL; - int i, m; - - vpl = (LPD3DTLVERTEX *)temp_malloc(n*sizeof(*vpl)); - - for (i=0; i= 0) - mprintf("bad poly: %i\n", bad_poly); -} - -void lgd3d_set_test_poly(int i) -{ - test_poly = i; - if (test_poly >= 0) - mprintf("test poly: %i\n", test_poly); -} - -void ReadPoly(void) -{ - int n; - LPD3DTLVERTEX vlist; - static FILE *id = NULL; - if (id == NULL) - id = fopen("badpoly.bin", "rb"); - - if (feof(id)) - return; - - fread(&n, sizeof(n), 1, id); - vlist = (LPD3DTLVERTEX )temp_malloc(n * sizeof(*vlist)); - fread(vlist, sizeof(*vlist), n, id); - - do_trifan(n, vlist); - temp_free(vlist); -} -#endif -#endif - diff --git a/libsrc/lgd3d/setup.c b/libsrc/lgd3d/setup.c deleted file mode 100644 index 0cf217f..0000000 --- a/libsrc/lgd3d/setup.c +++ /dev/null @@ -1,449 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/setup.c 1.31 1998/04/22 16:51:25 KEVIN Exp $ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define global -global LPD3DI lpd3d = NULL; -global LPD3DIDEVICE lpd3dDevice = NULL; -global LPDIRECTDRAWSURFACE lpddDevice = NULL; -global LPD3DIVIEWPORT lpd3dViewport = NULL; -global LPD3DIMATERIAL lpd3dBackgroundMaterial = NULL; -#ifndef USE_D3D2_API -global LPD3DIEXECUTEBUFFER lpd3dExecuteBuffer = NULL; -global LPD3DIEXECUTEBUFFER lpd3dExecuteBuffer2 = NULL; -#endif -global D3DMATERIALHANDLE hPolyMaterial = 0UL; -global texture_manager *g_tmgr = NULL; - -static LPDIRECTDRAWSURFACE lpddZBuffer = NULL; -static LPD3DIMATERIAL PolyMaterial = NULL; -static D3DMATERIALHANDLE hd3dBackgroundMaterial = 0UL; - -void lgd3d_set_hardware() -{ -} - -void lgd3d_set_software() -{ -} - -void lgd3d_set_RGB() -{ -} - -BOOL lgd3d_is_RGB() -{ - return TRUE; -} - -BOOL lgd3d_is_hardware() -{ - return TRUE; -} - - -static HRESULT InitMaterial(void) -{ - D3DMATERIAL d3dMaterial; - HRESULT hRes; - - hRes = IDirect3D_CreateMaterial( - lpd3d, - &lpd3dBackgroundMaterial, - NULL); - - if (FAILED(hRes)) - return hRes; - - hRes = IDirect3D_CreateMaterial( - lpd3d, - &PolyMaterial, - NULL); - - if (FAILED(hRes)) - return hRes; - - ZeroMemory(&d3dMaterial, sizeof(d3dMaterial)); - d3dMaterial.dwSize = sizeof(d3dMaterial); - - d3dMaterial.dcvDiffuse.r = D3DVAL(0.0); - d3dMaterial.dcvDiffuse.g = D3DVAL(0.0); - d3dMaterial.dcvDiffuse.b = D3DVAL(0.0); - d3dMaterial.dcvAmbient.r = D3DVAL(0.0); - d3dMaterial.dcvAmbient.g = D3DVAL(0.0); - d3dMaterial.dcvAmbient.b = D3DVAL(0.0); - d3dMaterial.dcvSpecular.r = D3DVAL(0.0); - d3dMaterial.dcvSpecular.g = D3DVAL(0.0); - d3dMaterial.dcvSpecular.b = D3DVAL(0.0); - d3dMaterial.dvPower = D3DVAL(0.0); - - /* - * As this is the background material we don't want a ramp allocated (we - * are not going to be smooth shading the background). - */ - d3dMaterial.dwRampSize = 1UL; - - hRes = lpd3dBackgroundMaterial->lpVtbl->SetMaterial(lpd3dBackgroundMaterial, - &d3dMaterial); - if (FAILED(hRes)) - return hRes; - hRes = lpd3dBackgroundMaterial->lpVtbl->GetHandle(lpd3dBackgroundMaterial, - lpd3dDevice, - &hd3dBackgroundMaterial); - if (FAILED(hRes)) - return hRes; - - hRes = lpd3dViewport->lpVtbl->SetBackground(lpd3dViewport, hd3dBackgroundMaterial); - if (FAILED(hRes)) - return hRes; - - d3dMaterial.diffuse.r = D3DVAL(1.0); - d3dMaterial.diffuse.g = D3DVAL(1.0); - d3dMaterial.diffuse.b = D3DVAL(1.0); - d3dMaterial.ambient.r = D3DVAL(1.0); - d3dMaterial.ambient.g = D3DVAL(1.0); - d3dMaterial.ambient.b = D3DVAL(1.0); - - hRes = PolyMaterial->lpVtbl->SetMaterial(PolyMaterial, - &d3dMaterial); - if (FAILED(hRes)) - return hRes; - hRes = PolyMaterial->lpVtbl->GetHandle(PolyMaterial, - lpd3dDevice, - &hPolyMaterial); - if (FAILED(hRes)) - return hRes; - - return DD_OK; -} - -//static LPDIRECTDRAWCOLORCONTROL lpcc=NULL; - -static DWORD FlagsToBitdepth(DWORD dwFlags) -{ - if (dwFlags & DDBD_1) - return 1UL; - else if (dwFlags & DDBD_2) - return 2UL; - else if (dwFlags & DDBD_4) - return 4UL; - else if (dwFlags & DDBD_8) - return 8UL; - else if (dwFlags & DDBD_16) - return 16UL; - else if (dwFlags & DDBD_24) - return 24UL; - else if (dwFlags & DDBD_32) - return 32UL; - else - return 0UL; /* Oh, please... */ -} - -static HRESULT CreateZBuffer(lgd3ds_device_info *info, LPDIRECTDRAW lpdd) -{ - DWORD bitDepth = info->device_desc->dwDeviceZBufferBitDepth; - DDSURFACEDESC ddsd; - HRESULT hRes; - - if (0UL == bitDepth) - return ~DD_OK; - - bitDepth = FlagsToBitdepth(bitDepth); - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | - DDSD_WIDTH | - DDSD_HEIGHT | - DDSD_ZBUFFERBITDEPTH; - ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY; - ddsd.dwWidth = grd_cap->w; - ddsd.dwHeight = grd_cap->h; - ddsd.dwZBufferBitDepth= bitDepth; - hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &lpddZBuffer, NULL); - - if (FAILED(hRes)) { - info->flags &= ~LGD3DF_ZBUFFER; - return hRes; - } - - hRes = lpddDevice->lpVtbl->AddAttachedSurface(lpddDevice, lpddZBuffer); - - if (FAILED(hRes)) - return hRes; - - return DD_OK; -} - -// sadly, this really doesn't work. Drivers get really upset when you -// try to lock the z buffer -#if 0 -void lgd3d_blit_zbuffer(void) -{ - DDSURFACEDESC ddsd; - HRESULT hres; - grs_bitmap bm; - - hres = lpddZBuffer->lpVtbl->Lock(lpddZBuffer, NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT, NULL); - AssertMsg1 (hres == DD_OK, "Lock failed: %x", hres); - - gr_init_bitmap(&bm, ddsd.lpSurface, BMT_FLAT16, 0, grd_cap->w, grd_cap->h); - bm.row = ddsd.lPitch; - gr_bitmap(&bm, 0, 0); -} -#endif - -static void CreateDevice(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info *info) -{ - HRESULT hRes; - LPDIRECTDRAW lpdd; - DDSURFACEDESC desc; - IWinDisplayDevice * pWinDisplayDevice; - - // @TBD: Set display device kind _and_ set screen mode - // For now, assume already done. - - pWinDisplayDevice = AppGetObj (IWinDisplayDevice); - - // get direct draw object from WinDisplayDevice - VerifyMsg(IWinDisplayDevice_GetDirectDraw(pWinDisplayDevice, &lpdd), - "Couldn't get direct draw object"); - - AssertMsg(NULL != lpdd, "NULL ddraw object"); - - hRes = lpdd->lpVtbl->QueryInterface(lpdd, &IID_ID3D, &lpd3d); - - AssertMsg(!(FAILED(hRes)), "Couldn't get d3d object from direct draw."); - AssertMsg(NULL != lpd3d, "NULL d3d object"); - - AssertMsg(NULL == lpddDevice, "ddraw device already present"); - AssertMsg(NULL == lpd3dDevice, "d3d device already present"); - - - hRes = IWinDisplayDevice_GetBitmapSurface(pWinDisplayDevice, NULL, &lpddDevice); - AssertMsg(!FAILED(hRes), "GetBitmapSurface failed."); - - AssertMsg((lpddDevice != NULL), "No render surface available."); - - if (lpddDevice->lpVtbl->IsLost(lpddDevice)) - lpddDevice->lpVtbl->Restore(lpddDevice); - -// hRes = lpddDevice->lpVtbl->QueryInterface(lpddDevice, &IID_IDirectDrawColorControl, -// (LPVOID *)&lpcc); -// AssertMsg1(!FAILED(hRes), "Query for ColorControl failed. Error %i", hRes&0xffff); - - ZeroMemory(&desc, sizeof(desc)); - desc.dwSize = sizeof(desc); - - hRes = lpddDevice->lpVtbl->GetSurfaceDesc(lpddDevice, &desc); - -#ifdef DEBUG - if (FAILED(hRes)) - Warning(("CreateDevice(): GetSurfaceDesc surface failed: %x\n", hRes)); - - if (!(desc.dwFlags & DDSD_CAPS)) - Warning(("CreateDevice(): flags indicate caps field not valid!\n")); - - if (desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - Warning(("CreateDevice(): Rendering to primary surface!\n")); -#endif - - pWinDisplayDevice->lpVtbl->Release(pWinDisplayDevice); - - if (info->flags & LGD3DF_ZBUFFER) { - hRes = CreateZBuffer(info, lpdd); - if (hRes != DD_OK) - info->flags &= ~LGD3DF_ZBUFFER; - } - -#ifdef USE_D3D2_API - hRes = lpd3d->lpVtbl->CreateDevice(lpd3d, &info->device_guid, lpddDevice, &lpd3dDevice); -#else - hRes = lpddDevice->lpVtbl->QueryInterface(lpddDevice, info->device_guid, &lpd3dDevice); -#endif - - AssertMsg1(!FAILED(hRes), "CreateDevice failed. hres = %i",hRes&0xffff); - - hRes = lpd3d->lpVtbl->CreateViewport(lpd3d, &lpd3dViewport, NULL); - - AssertMsg(!FAILED(hRes), "CreateViewport failed."); - - if (lpd3dDevice == NULL) - Error(1, "Failed to create direct3D device"); - - hRes = lpd3dDevice->lpVtbl->AddViewport(lpd3dDevice, lpd3dViewport); - - AssertMsg(!FAILED(hRes), "AddViewport failed."); - -#ifdef USE_D3D2_API - hRes = lpd3dDevice->lpVtbl->SetCurrentViewport(lpd3dDevice, lpd3dViewport); - - AssertMsg(!FAILED(hRes), "SetCurrentViewport failed."); -#endif - - lpdd->lpVtbl->Release(lpdd); -} - -#ifdef USE_D3D2_API - -#define CreateExecuteBuffer() -#define ReleaseExecuteBuffer() - -#else - -static void ReleaseExecuteBuffer() -{ - SafeRelease(lpd3dExecuteBuffer); - SafeRelease(lpd3dExecuteBuffer2); -} - -static void CreateExecuteBuffer() -{ - D3DEXECUTEBUFFERDESC d3dExecuteBufferDesc; - HRESULT hRes; - - ZeroMemory(&d3dExecuteBufferDesc, sizeof(d3dExecuteBufferDesc)); - d3dExecuteBufferDesc.dwSize = sizeof(d3dExecuteBufferDesc); - d3dExecuteBufferDesc.dwFlags = D3DDEB_BUFSIZE; - d3dExecuteBufferDesc.dwBufferSize = 1024; - hRes = lpd3dDevice->lpVtbl->CreateExecuteBuffer(lpd3dDevice, - &d3dExecuteBufferDesc, - &lpd3dExecuteBuffer, - NULL); - - AssertMsg(!FAILED(hRes), "CreateExecuteBuffer failed."); - ZeroMemory(&d3dExecuteBufferDesc, sizeof(d3dExecuteBufferDesc)); - d3dExecuteBufferDesc.dwSize = sizeof(d3dExecuteBufferDesc); - d3dExecuteBufferDesc.dwFlags = D3DDEB_BUFSIZE; - d3dExecuteBufferDesc.dwBufferSize = 1024; - hRes = lpd3dDevice->lpVtbl->CreateExecuteBuffer(lpd3dDevice, - &d3dExecuteBufferDesc, - &lpd3dExecuteBuffer2, - NULL); - - AssertMsg(!FAILED(hRes), "CreateExecuteBuffer failed."); -} - -#endif - - -void lgd3d_shutdown(void) -{ - extern void lgd3d_render_shutdown(void); - - lgd3d_render_shutdown(); - ShutdownTextureSys(); - SafeRelease(lpd3dBackgroundMaterial); - SafeRelease(PolyMaterial); - ReleaseExecuteBuffer(); - SafeRelease(lpd3dViewport); - SafeRelease(lpd3dDevice); - SafeRelease(lpddDevice); - SafeRelease(lpddZBuffer); - SafeRelease(lpd3d); -} - -BOOL lgd3d_init(lgd3ds_device_info *device_info) -{ - extern void lgd3d_render_init(lgd3ds_device_info *info); - - // @TBD: get w and h from app; set mode in CreateDevice() - CreateDevice(grd_cap->w, grd_cap->h, device_info); - - CreateExecuteBuffer(); - - VerifyMsg(InitMaterial()==DD_OK, "InitMaterial failed"); - - InitTextureSys(device_info); - - lgd3d_start_frame(0); - lgd3d_render_init(device_info); - lgd3d_end_frame(); -} - -static HRESULT InitViewport(void) -{ - D3DSVIEWPORT d3dViewport; - - AssertMsg(NULL != lpd3dViewport,"hey, no viewport!"); - - ZeroMemory(&d3dViewport, sizeof(d3dViewport)); - d3dViewport.dwSize = sizeof(d3dViewport); - d3dViewport.dwX = 0UL; - d3dViewport.dwY = 0UL; - d3dViewport.dwWidth = (DWORD)grd_cap->w; // width in pixels - d3dViewport.dwHeight = (DWORD)grd_cap->h; // height in pixels -#ifdef USE_D3D2_API - d3dViewport.dvClipX = D3DVAL(-1.0); - d3dViewport.dvClipY = D3DVAL(-1.0); - d3dViewport.dvClipWidth = D3DVAL(2.0); - d3dViewport.dvClipHeight = D3DVAL(2.0); - d3dViewport.dvMinZ = D3DVAL(0.0); - d3dViewport.dvMaxZ = D3DVAL(1.0); - return lpd3dViewport->lpVtbl->SetViewport2(lpd3dViewport, &d3dViewport); -#else - d3dViewport.dvScaleX = D3DVAL((float)d3dViewport.dwWidth / 2.0); - d3dViewport.dvScaleY = D3DVAL((float)d3dViewport.dwHeight / 2.0); - d3dViewport.dvMaxX = D3DVAL(1.0); - d3dViewport.dvMaxY = D3DVAL(1.0); - return lpd3dViewport->lpVtbl->SetViewport(lpd3dViewport, &d3dViewport); -#endif -} - -uchar *lgd3d_clut = NULL; -uchar *lgd3d_set_clut(uchar *clut) -{ - uchar *old_clut = lgd3d_clut; - lgd3d_clut = clut; - lgd3d_set_texture_clut(clut); - return old_clut; -} - -void lgd3d_start_frame(int frame) -{ - HRESULT hRes; - extern void lgd3d_render_start_frame(void); - - hRes = lpd3dDevice->lpVtbl->BeginScene(lpd3dDevice); - AssertMsg(!(FAILED(hRes)), "BeginScene failed"); - - hRes = InitViewport(); - AssertMsg1(!(FAILED(hRes)), "InitViewport failed: Error %d", hRes&0xffff); - - lgd3d_render_start_frame(); - - if (g_tmgr!=NULL) - g_tmgr->start_frame(frame); // set current frame and use default texture - -} - -void lgd3d_end_frame(void) -{ - HRESULT hRes; - extern void lgd3d_render_end_frame(void); - - lgd3d_render_end_frame(); - hRes = lpd3dDevice->lpVtbl->EndScene(lpd3dDevice); - AssertMsg(!(FAILED(hRes)), "EndScene failed"); - - if (g_tmgr!=NULL) - g_tmgr->end_frame(); -} - -BOOL lgd3d_overlays_master_switch(BOOL bOverlaysOn) -{ - return FALSE; // TODO -} diff --git a/libsrc/lgd3d/setup.h b/libsrc/lgd3d/setup.h deleted file mode 100644 index ebbb207..0000000 --- a/libsrc/lgd3d/setup.h +++ /dev/null @@ -1,41 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/setup.h 1.7 1997/10/28 15:29:27 KEVIN Exp $ - -#ifndef __SETUP_H -#define __SETUP_H - -#include -#include - -#ifdef USE_D3D2_API -#define IID_ID3D IID_IDirect3D2 -#define IID_ID3DTexture IID_IDirect3DTexture2 -#define LPD3DI LPDIRECT3D2 -#define LPD3DIDEVICE LPDIRECT3DDEVICE2 -#define LPD3DIVIEWPORT LPDIRECT3DVIEWPORT2 -#define LPD3DIMATERIAL LPDIRECT3DMATERIAL2 -#define LPD3DITEXTURE LPDIRECT3DTEXTURE2 -#define LPD3DIMATERIAL LPDIRECT3DMATERIAL2 -#define D3DSVIEWPORT D3DVIEWPORT2 -#else -#define IID_ID3D IID_IDirect3D -#define IID_ID3DTexture IID_IDirect3DTexture -#define LPD3DI LPDIRECT3D -#define LPD3DIDEVICE LPDIRECT3DDEVICE -#define LPD3DIVIEWPORT LPDIRECT3DVIEWPORT -#define LPD3DIMATERIAL LPDIRECT3DMATERIAL -#define LPD3DITEXTURE LPDIRECT3DTEXTURE -#define LPD3DIMATERIAL LPDIRECT3DMATERIAL -#define D3DSVIEWPORT D3DVIEWPORT -#endif -#define LPD3DIEXECUTEBUFFER LPDIRECT3DEXECUTEBUFFER - -extern LPD3DIEXECUTEBUFFER lpd3dExecuteBuffer; -extern LPD3DIEXECUTEBUFFER lpd3dExecuteBuffer2; -extern LPDIRECTDRAWSURFACE lpddDevice; -extern LPD3DIDEVICE lpd3dDevice; -extern LPD3DIVIEWPORT lpd3dViewport; -extern LPD3DI lpd3d; -extern D3DMATERIALHANDLE hPolyMaterial; -extern LPD3DIMATERIAL lpd3dBackgroundMaterial; -extern uchar *lgd3d_clut; -#endif diff --git a/libsrc/lgd3d/tdrv.h b/libsrc/lgd3d/tdrv.h deleted file mode 100644 index 2fa03af..0000000 --- a/libsrc/lgd3d/tdrv.h +++ /dev/null @@ -1,44 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/tdrv.h 1.8 1998/03/06 13:02:31 KEVIN Exp $ -#ifndef __TDRV_H -#define __TDRV_H - -typedef struct grs_bitmap grs_bitmap; - -typedef struct tdrv_texture_info { - grs_bitmap *bm; - int id; - int flags; - int scale_w; - int scale_h; - int w, h; - int size; - uchar *bits; - ulong cookie; -} tdrv_texture_info; - - -typedef struct texture_driver { - int (*load_texture)(tdrv_texture_info *info); - void (*release_texture)(int n); - void (*set_texture_id)(int n); - void (*unload_texture)(int n); // disconnect texture from bitmap - void (*synchronize)(void); - void (*start_frame)(int n); - void (*end_frame)(void); - void (*reload_texture)(tdrv_texture_info *info); - void (*cook_info)(tdrv_texture_info *info); -} texture_driver; - -#define TDRV_FAILURE -1 -#define TDRV_SUCCESS 0 - -#define TDRV_ID_SOLID -1 -#define TDRV_ID_CALLBACK -2 -#define TDRV_ID_INVALID -3 - -// texture flags -#define TF_ALPHA 1 -#define TF_RGB 2 -#define TF_TRANS 4 - -#endif diff --git a/libsrc/lgd3d/texmgr.cpp b/libsrc/lgd3d/texmgr.cpp new file mode 100644 index 0000000..b6b0532 --- /dev/null +++ b/libsrc/lgd3d/texmgr.cpp @@ -0,0 +1,35 @@ +#include + + +texture_manager *get_dopey_texture_manager(cD6States *driver); +unsigned __int8 *tmgr_set_clut(unsigned __int8 *clut); +unsigned int tmgr_bytes_loaded(); +int tmgr_get_utilization(float *utilization); +void tmgr_restore_bits(grs_bitmap *bm); +void swapout_bitmap(tdrv_texture_info *info, tmap_chain *chain); +void do_unload(grs_bitmap *bm); +void release_texture(int i); +int dump_all_textures(); +void tmgr_unload_texture(grs_bitmap *bm); +void tmgr_reload_texture(grs_bitmap *bm); +void tmgr_load_texture(grs_bitmap *bm); +int do_load_1(tdrv_texture_info *info); +void tmgr_set_texture(grs_bitmap *bm); +void do_set_texture(grs_bitmap *bm); +void tmgr_set_texture_callback(); +void tmgr_start_frame(int frame); +void tmgr_end_frame(); +int tmgr_init(grs_bitmap *bm, int num_textures, int *size_list, int num_sizes); +tmgr_texture_info *init_bitmap_list(); +void tmgr_shutdown(); +int tmgr_stats(); + +int lgd3d_enumerate_devices(); +int lgd3d_enumerate_devices_capable_of(unsigned int flags); +void lgd3d_unenumerate_devices(); +lgd3ds_device_info *lgd3d_get_device_info(int device_number); +int __stdcall c_DDEnumCallback(_GUID *lpGUID, char *lpDriverDescription, char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); +void GetDevices(LGD3D_sEnumerationInfo *info); +int __stdcall c_EnumDisplayModesCallback(_DDSURFACEDESC2 *pSD, char *data); +int __stdcall c_EnumDevicesCallback(_GUID *lpGuid, char *lpDeviceDescription, char *lpDeviceName, _D3DDeviceDesc *pDeviceDesc, _D3DDeviceDesc *lpD3DHELDeviceDesc, void *lpUserArg); +int (__stdcall *__thiscall __cDynFunc__DirectDrawEnumerateA::GetProcAddress(__cDynFunc__DirectDrawEnumerateA *this))(int (__stdcall *)(_GUID *, char *, char *, void *), void *); diff --git a/libsrc/lgd3d/texture.c b/libsrc/lgd3d/texture.c deleted file mode 100644 index e433973..0000000 --- a/libsrc/lgd3d/texture.c +++ /dev/null @@ -1,1312 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/texture.c 1.45 1998/04/27 15:00:24 KEVIN Exp $ -#define WIN32_LEAN_AND_MEAN -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#ifndef SHIP -static const char *hResErrorMsg = "%s:\nFacility %i, Error %i"; -#endif -#define CheckHResult(hRes, msg) \ -AssertMsg3(hRes==0, hResErrorMsg, msg, (hRes>>16)&0x7fff, hRes&0xffff) - -#ifndef SHIP -#include -static BOOL spew; -#define mono_printf(x) \ -do { \ - if (spew) \ - mprintf x ; \ -} while (0) -#else -#define mono_printf(x) -#endif - -#ifdef MONO_SPEW -#define put_mono(c) \ -do { \ - uchar *p_mono = (uchar *)0xb0086; \ - *p_mono = c; \ -} while (0) -#else -#define put_mono(c) -#endif - -#define GBitMask15 0x3e0 -#define GBitMask16 0x7e0 - -D3DMATERIALHANDLE MaterialHandle[LGD3D_MAX_TEXTURES]; -D3DTEXTUREHANDLE TextureHandle[LGD3D_MAX_TEXTURES]; -grs_bitmap *TdrvBitmap[LGD3D_MAX_TEXTURES]; - -#define PF_GENERIC 0 -#define PF_RGB 1 -#define PF_ALPHA 2 -#define PF_MASK 3 -#define PF_MAX 3 -#define PF_TRANS 128 - - -typedef struct d3d_cookie { - union { - struct { - uchar wlog, hlog; - uchar flags; - uchar palette; - }; - ulong value; - }; -} d3d_cookie; - -static DDPIXELFORMAT AlphaTextureFormat; -static DDPIXELFORMAT RGBTextureFormat; -static DDPIXELFORMAT PalTextureFormat; -static LPDDPIXELFORMAT FormatList[PF_MAX]; -static DWORD DeviceSurfaceCaps; -static BOOL texture_RGB = FALSE; -static BOOL prefer_RGB = FALSE; -static BOOL using_local = FALSE; -static BOOL local_available = FALSE; -static BOOL agp_available = FALSE; - -static BOOL TextureListInited = FALSE; -static LPD3DITEXTURE Texture[LGD3D_MAX_TEXTURES]; -static LPDIRECTDRAWSURFACE Surface[LGD3D_MAX_TEXTURES]; - -static LPD3DIMATERIAL Material[LGD3D_MAX_TEXTURES]; - -#define MAX_PALETTES 256 - -static grs_bitmap *default_bm = NULL; -static LPDIRECTDRAWPALETTE lpDDPalTexture[MAX_PALETTES]; -static LPDIRECTDRAW lpdd=NULL; -static LPDIRECTDRAW2 lpdd2=NULL; -static IWinDisplayDevice * pWinDisplayDevice = NULL; - -static void CheckSurfaces(sWinDispDevCallbackInfo *data); -static int callback_id = 0; - -static ushort default_alpha_pal[256]; -static ushort *texture_pal[MAX_PALETTES]; -static ushort *alpha_pal = NULL; -static uchar *texture_clut=NULL; -static DevDesc *device_desc; -static DWORD texture_caps; - -void ShutdownTextureSys(void) -{ - int i; - - if (TextureListInited) { - if (g_tmgr!=NULL) { - g_tmgr->shutdown(); - g_tmgr = NULL; - } - - pWinDisplayDevice->lpVtbl->RemoveTaskSwitchCallback( - pWinDisplayDevice, callback_id); - - // this is actually redundant since tmgr should take - // care of it, but it can't really hurt... - for (i=0; iset_clut(clut); -} - -void lgd3d_set_alpha_pal(ushort *pal) -{ - alpha_pal = pal; -} - -void lgd3d_texture_set_RGB(bool is_RGB) -{ - prefer_RGB = is_RGB; -} - -void lgd3d_get_texture_bitmask(grs_rgb_bitmask *bitmask) -{ - if (RGBTextureFormat.dwFlags == 0) - RGBTextureFormat.dwRBitMask = - RGBTextureFormat.dwGBitMask = - RGBTextureFormat.dwBBitMask = 0; - - bitmask->red = RGBTextureFormat.dwRBitMask; - bitmask->green = RGBTextureFormat.dwGBitMask; - bitmask->blue = RGBTextureFormat.dwBBitMask; -} - - -static HRESULT InitMaterial(int tex_id) -{ - D3DMATERIAL d3dMaterial; - HRESULT hRes; - LPD3DIMATERIAL Mat; - - AssertMsg((tex_id>=0)&&(tex_idlpVtbl->CreateMaterial( - lpd3d, - &Mat, - NULL); - - if (FAILED(hRes)) - return hRes; - - Material[tex_id] = Mat; - - ZeroMemory(&d3dMaterial, sizeof(d3dMaterial)); - d3dMaterial.dwSize = sizeof(d3dMaterial); - - d3dMaterial.diffuse.r = D3DVAL(1.0); - d3dMaterial.diffuse.g = D3DVAL(1.0); - d3dMaterial.diffuse.b = D3DVAL(1.0); - d3dMaterial.ambient.r = D3DVAL(1.0); - d3dMaterial.ambient.g = D3DVAL(1.0); - d3dMaterial.ambient.b = D3DVAL(1.0); - d3dMaterial.specular.r = D3DVAL(0.0); - d3dMaterial.specular.g = D3DVAL(0.0); - d3dMaterial.specular.b = D3DVAL(0.0); - d3dMaterial.dvPower = D3DVAL(0.0); - d3dMaterial.hTexture = TextureHandle[tex_id]; - d3dMaterial.dwRampSize = 1UL; - - hRes = Mat->lpVtbl->SetMaterial(Mat, &d3dMaterial); - if (FAILED(hRes)) - return hRes; - - hRes = Mat->lpVtbl->GetHandle(Mat, - lpd3dDevice, - &MaterialHandle[tex_id]); - - if (FAILED(hRes)) - return hRes; - - return DD_OK; -} - - -static HRESULT CALLBACK EnumTextureFormatsCallback(LPDDSURFACEDESC lpDDSD, LPVOID lpContext) -{ - DDPIXELFORMAT *fmt = &lpDDSD->ddpfPixelFormat; - -#ifdef SPEW_FORMATS - if (fmt->dwFlags&DDPF_RGB) { - mono_printf(("RGB bits: %i, alpha bits: %i\n", fmt->dwRGBBitCount, fmt->dwAlphaBitDepth)); - mono_printf(("bitmasks: A %x, R %x G %x B %x\n", - fmt->dwRGBAlphaBitMask, fmt->dwRBitMask, fmt->dwGBitMask, fmt->dwBBitMask)); - } -#endif - - // Grab 4444 alpha format... - if ((fmt->dwFlags&DDPF_RGB)&&(fmt->dwRGBBitCount==16)&& - (fmt->dwRGBAlphaBitMask == 0xf000)&& - (fmt->dwRBitMask == 0xf00)&& - (fmt->dwGBitMask == 0xf0)&& - (fmt->dwBBitMask == 0xf)) { - memcpy(&AlphaTextureFormat, fmt, sizeof(AlphaTextureFormat)); - } - // Grab 16 bit no alpha format... - else if ((fmt->dwFlags == DDPF_RGB)&& - (fmt->dwRGBBitCount == 16)) - { - if ((fmt->dwGBitMask == GBitMask16) || - (fmt->dwGBitMask == GBitMask15)) { - memcpy(&RGBTextureFormat, fmt, sizeof(RGBTextureFormat)); - } - } - // Grab 8 bit palettized format - else if (lpDDSD->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { - memcpy(&PalTextureFormat, &lpDDSD->ddpfPixelFormat, sizeof(PalTextureFormat)); - } - - return DDENUMRET_OK; -} - -#define NONLOCAL_CAPS DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM | DDSCAPS_ALLOCONLOAD -#define LOCAL_CAPS DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ALLOCONLOAD - -static void EnumTextureFormats(void) -{ - HRESULT hRes; - D3DDEVICEDESC hal, hel; - LPDIRECTDRAWSURFACE test_surf; - DDSURFACEDESC ddsd; - - - ZeroMemory(&RGBTextureFormat, sizeof(RGBTextureFormat)); - ZeroMemory(&PalTextureFormat, sizeof(PalTextureFormat)); - - hRes = lpd3dDevice->lpVtbl->EnumTextureFormats(lpd3dDevice, EnumTextureFormatsCallback, NULL); - CheckHResult(hRes, "EnumTextureFormats failed"); - - texture_RGB = prefer_RGB; - FormatList[PF_GENERIC] = texture_RGB ? &RGBTextureFormat : &PalTextureFormat; - if (FormatList[PF_GENERIC]->dwFlags == 0) { - texture_RGB = !texture_RGB; - FormatList[PF_GENERIC] = texture_RGB ? &RGBTextureFormat : &PalTextureFormat; - if (FormatList[PF_GENERIC]->dwFlags == 0) - CriticalMsg("Direct3D device does not support 8 bit palettized or 15 or 16 bit RGB textures"); - } - - FormatList[PF_RGB] = &RGBTextureFormat; - FormatList[PF_ALPHA] = &AlphaTextureFormat; - - mono_printf(("Using %s textures\n",texture_RGB ? "16 bit RGB" : "Palettized")); - - if (AlphaTextureFormat.dwFlags == 0) - mono_printf(("no alpha texture format available.\n")); - - - ZeroMemory(&hal, sizeof(hal)); - hal.dwSize = sizeof(hal); - ZeroMemory(&hel, sizeof(hel)); - hel.dwSize = sizeof(hel); - - hRes = lpd3dDevice->lpVtbl->GetCaps(lpd3dDevice, &hal, &hel); - CheckHResult(hRes, "Failed to obtain device caps"); - - AssertMsg(hal.dwFlags & D3DDD_DEVCAPS, "No HAL device!"); - - ZeroMemory(&ddsd, sizeof(ddsd)); - memcpy(&ddsd.ddpfPixelFormat, FormatList[PF_GENERIC], sizeof(ddsd.ddpfPixelFormat)); - ddsd.dwHeight = 256; - ddsd.dwWidth = 256; - agp_available = FALSE; - local_available = FALSE; - - if (hal.dwDevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM) { - ddsd.dwSize = sizeof(DDSURFACEDESC); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = NONLOCAL_CAPS; - hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &test_surf, NULL); - if ((hRes == DD_OK) && (test_surf != NULL)) { - SafeRelease(test_surf); - agp_available = TRUE; - DeviceSurfaceCaps = NONLOCAL_CAPS; - mono_printf(("nonlocal videomemory textures available.\n")); - } - } - - if (hal.dwDevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) { - ddsd.dwSize = sizeof(DDSURFACEDESC); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = LOCAL_CAPS; - hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &test_surf, NULL); - if ((hRes == DD_OK) && (test_surf != NULL)) { - SafeRelease(test_surf); - local_available = TRUE; - DeviceSurfaceCaps = LOCAL_CAPS; - mono_printf(("local videomemory textures available.\n")); - } - } - - if (!(agp_available||local_available)) { - mono_printf(("No local or nonlocal texture memory! Using system memory textures.\n")); - DeviceSurfaceCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_ALLOCONLOAD; - } - using_local = local_available; -} - -static void GetDirectDraw(void) -{ - HRESULT hRes; - - pWinDisplayDevice = AppGetObj (IWinDisplayDevice); - - lpdd = NULL; - IWinDisplayDevice_GetDirectDraw(pWinDisplayDevice, &lpdd); - AssertMsg(lpdd!=NULL, "GetDirectDraw failed"); - - hRes = lpdd->lpVtbl->QueryInterface(lpdd, &IID_IDirectDraw2, (LPVOID *)&lpdd2); - CheckHResult(hRes, "Query for DirectDraw2 failed"); -} - - -static void SetTexturePalette(int start, int n, uchar *pal, int slot) -{ - PALETTEENTRY peColorTable[256]; - HRESULT hRes; - int i; - - if (lpDDPalTexture[slot] == NULL) - { - hRes = lpdd->lpVtbl->CreatePalette(lpdd, - DDPCAPS_8BIT | DDPCAPS_ALLOW256, - peColorTable, - &lpDDPalTexture[slot], - NULL); - CheckHResult(hRes, "CreatePalette failed."); - } - - for (i = 0; i < n; i++) { - peColorTable[i].peFlags = D3DPAL_READONLY | PC_RESERVED; - peColorTable[i].peRed = pal[3*i]; - peColorTable[i].peGreen = pal[3*i+1]; - peColorTable[i].peBlue = pal[3*i+2]; - } - - hRes = lpDDPalTexture[slot]->lpVtbl->SetEntries(lpDDPalTexture[slot], - 0, start, n, peColorTable); - - CheckHResult(hRes, "SetEntries failed."); -} - -void lgd3d_set_pal_slot(uint start, uint n, uchar *pal_data, int slot) -{ - grs_rgb_bitmask bitmask; - - if (lpdd == NULL) - return; - - if (!texture_RGB) - { - SetTexturePalette(start, n, pal_data, slot); - } - else - { - if (texture_pal[slot]==NULL) - texture_pal[slot] = (ushort *)gr_malloc(512); - lgd3d_get_texture_bitmask(&bitmask); - gr_make_pal16(start, n, texture_pal[slot], pal_data, &bitmask); - } -} - -BOOL lgd3d_get_texture_wrapping(DWORD dwLevel) -{ - return FALSE; // TODO -} - -BOOL lgd3d_set_texture_wrapping(DWORD dwLevel, BOOL bSetSmooth) -{ - return FALSE; // TODO -} - -void lgd3d_set_pal(uint start, uint n, uchar *pal_data) -{ - lgd3d_set_pal_slot(start, n, pal_data, 0); -} - -static int chroma_r=0; -static int chroma_g=0; -static int chroma_b=0; -static DWORD chroma_key; - -// values should be 0..255 -void lgd3d_set_chromakey(int r, int g, int b) -{ - chroma_r = r; - chroma_g = g; - chroma_b = b; - if (RGBTextureFormat.dwRBitMask == 0x1f) { - // swap red and blue - r = chroma_b; - b = chroma_r; - } - chroma_key = b>>3; - if (RGBTextureFormat.dwGBitMask == GBitMask15) { - chroma_key += ((g>>3)<<5) + ((r>>3)<<10); - } else { - chroma_key += ((g>>2)<<5) + ((r>>3)<<11); - } -} - -void lgd3d_set_dithering(int bOn) -{ - // TODO -} - -int lgd3d_is_dithering_on(void) -{ - return 0; // TODO -} - -void lgd3d_set_antialiasing(int bOn) -{ - // TODO -} - -int lgd3d_is_antialiasing_on(void) -{ - return 0; // TODO -} - - -static int FindClosestColor(float r, float g, float b) -{ - float best=3*256*256; - uchar *pal = grd_pal; - int i, color = -1; - - for (i=0; i<256; i++) { - float test, dr, dg, db; - dr = r - pal[0]; - dg = g - pal[1]; - db = b - pal[2]; - pal += 3; - test = dr*dr + db*db + dg*dg; - if (test < best) { - best = test; - color = i; - } - } - AssertMsg(color>=0,"Couldn't fit color."); - return color; -} - -static void InitDefaultTexture(int size) -{ - grs_bitmap *bm; - int c0, c1, i, j; - - bm = gr_alloc_bitmap(BMT_FLAT8, 0, size, size); - c0 = FindClosestColor(180.0, 10.0, 10.0); - c1 = FindClosestColor(10.0, 180.0, 10.0); - for (i=0; ibits[size*i+j] = ((i+j)&1) ? c0:c1; - - default_bm = bm; -} - -static void InitTextureList(void) -{ - int i; - for (i=0; ishutdown(); - g_tmgr = NULL; - } - - g_tmgr = get_dopey_texture_manager(&driver); - g_tmgr->init( - default_bm, - LGD3D_MAX_TEXTURES, NULL, 0, - (info->flags & LGD3DF_SPEW) ? TMGRF_SPEW:0); - -} - - -void InitTextureSys(lgd3ds_device_info *info) -{ - int i; - - if (lpdd!=NULL) { - Warning(("Texture system already inited.\n")); - return; - } - -#ifndef SHIP - spew = ((info->flags & LGD3DF_SPEW) != 0); -#endif - device_desc = info->device_desc; - texture_caps = device_desc->dpcTriCaps.dwTextureCaps; - GetDirectDraw(); - EnumTextureFormats(); - for (i=0; ilpVtbl->AddTaskSwitchCallback( - pWinDisplayDevice, CheckSurfaces); - InitDefaultTexture(16); - InitTextureManager(info); -} - - - -/***************************************************************************/ -/* Loading a grs_bitmap into a system memory surface */ -/***************************************************************************/ -/* - * LoadSurface - * Loads a grs_bitmap into a texture map DD surface of the given format. The - * memory flag specifies DDSCAPS_SYSTEMMEMORY or DDSCAPS_VIDEOMEMORY. - */ - -static HRESULT CreateSurface(d3d_cookie cookie, DDSURFACEDESC *ddsd, LPDIRECTDRAWSURFACE *ppDDS) -{ - DDCOLORKEY ck; - HRESULT ddrval; - LPDIRECTDRAWSURFACE pDDS; - DWORD ckey; - - ddrval = lpdd->lpVtbl->CreateSurface(lpdd, ddsd, ppDDS, NULL); - if (ddrval != DD_OK) - return ddrval; - - pDDS = *ppDDS; - - // Bind the palette, if necessary - if (ddsd->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { - ddrval = pDDS->lpVtbl->SetPalette(pDDS, lpDDPalTexture[cookie.palette]); - CheckHResult(ddrval, "SetPalette failed while creating surface."); - ckey = 0; - } else - ckey = chroma_key; - - // Set colorkey, if necessary - if (PF_TRANS & cookie.flags) { - ck.dwColorSpaceLowValue = ckey; - ck.dwColorSpaceHighValue = ckey; - ddrval = pDDS->lpVtbl->SetColorKey(pDDS, DDCKEY_SRCBLT, &ck); - CheckHResult(ddrval, "SetColorKey failed while creating surface."); - } - - return DD_OK; -} - - -// OK, here are our various specialized blitters - -static void blit_8to16(tdrv_texture_info *info, ushort *dst, int drow, ushort *pal) -{ - int i, j; - grs_bitmap *bm = info->bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - for (j=0; jw; j++) - dst[j] = pal[src[j]]; - src += bm->row; - dst += drow; - } -} - -static void blit_8to16_clut(tdrv_texture_info *info, ushort *dst, int drow, ushort *pal) -{ - int i, j; - grs_bitmap *bm = info->bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - for (j=0; jw; j++) - dst[j] = pal[texture_clut[src[j]]]; - src += bm->row; - dst += drow; - } -} - -static void blit_8to16_scale(tdrv_texture_info *info, ushort *dst, int drow, ushort *pal) -{ - int i, j, k; - int scale_w = info->scale_w; - int scale_h = info->scale_h; - int step_w = 1<<(scale_w-1); - int step_h = (1<bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - if (scale_w>0) - { - ulong *base = (ulong *)dst; - for (j=0; jw; j++) - { - ulong c32 = pal[src[j]]; - c32 += (c32<<16); - for (k=0; kw; j++) - dst[j] = pal[src[j]]; - } - for (j=0; jw<row; - dst += drow; - } -} - -static void blit_8to16_clut_scale(tdrv_texture_info *info, ushort *dst, int drow, ushort *pal) -{ - int i, j, k; - int scale_w = info->scale_w; - int scale_h = info->scale_h; - int step_w = 1<<(scale_w-1); - int step_h = (1<bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - if (scale_w>0) - { - ulong *base = (ulong *)dst; - for (j=0; jw; j++) - { - ulong c32 = pal[texture_clut[src[j]]]; - c32 += (c32<<16); - for (k=0; kw; j++) - dst[j] = pal[texture_clut[src[j]]]; - } - for (j=0; jw<row; - dst += drow; - } -} - - -static void blit_8to8(tdrv_texture_info *info, uchar *dst, int drow) -{ - int i; - grs_bitmap *bm = info->bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - memcpy(dst, src, bm->w); - src += bm->row; - dst += drow; - } -} - -static void blit_8to8_clut(tdrv_texture_info *info, uchar *dst, int drow) -{ - int i, j; - grs_bitmap *bm = info->bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - for (j=0; jw; j++) - dst[j] = texture_clut[src[j]]; - src += bm->row; - dst += drow; - } -} - -static void blit_8to8_scale(tdrv_texture_info *info, uchar *dst, int drow) -{ - int i, j, k; - int scale_w = info->scale_w; - int scale_h = info->scale_h; - int step_w = 1<bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - if (scale_w > 0) { - uchar *base = dst; - for (j=0; jw; j++) { - uchar c = src[j]; - for (k=0; kw); - for (j = 0; jw); - dst += drow; - } - src += bm->row; - dst += drow; - } -} - -static void blit_8to8_clut_scale(tdrv_texture_info *info, uchar *dst, int drow) -{ - int i, j, k; - int scale_w = info->scale_w; - int scale_h = info->scale_h; - int step_w = 1<bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - uchar *base = dst; - for (j=0; jw; j++) { - uchar c = texture_clut[src[j]]; - for (k=0; kw); - dst += drow; - } - src += bm->row; - dst += drow; - } -} - - -static void blit_16to16(tdrv_texture_info *info, ushort *dst, int drow) -{ - int i; - grs_bitmap *bm = info->bm; - uchar *src = info->bits; - - for (i=0; ih; i++) { - memcpy(dst, src, 2*bm->w); - src += bm->row; - dst += drow; - } -} - - -static void blit_16to16_scale(tdrv_texture_info *info, ushort *dst, int drow) -{ - int i, j, k; - int scale_w = info->scale_w; - int scale_h = info->scale_h; - int step_w = 1<bm; - int srow = bm->row>>1; - ushort *src = (ushort *)info->bits; - - for (i=0; ih; i++) { - if (step_w > 1) { - ushort *base = dst; - for (j=0; jw; j++) { - ushort c = src[j]; - for (k=0; kw); - for (j = 0; jw); - dst += drow; - } - src += srow; - dst += drow; - } -} - - -static void LoadSurface(tdrv_texture_info *info, DDSURFACEDESC *ddsd) -{ - uchar *src; - grs_bitmap *bm = info->bm; - int flags = info->flags; - uchar zero_save = 0; - - if ((texture_clut != NULL) && (bm->flags & BMF_TRANS)) - { - zero_save = texture_clut[0]; - texture_clut[0] = 0; - } - - if (ddsd->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { - uchar *dst = (uchar *)ddsd->lpSurface; - if ((info->scale_w|info->scale_h) != 0) - if (texture_clut!=NULL) - blit_8to8_clut_scale(info, dst, ddsd->lPitch); - else - blit_8to8_scale(info, dst, ddsd->lPitch); - else - if (texture_clut!=NULL) - blit_8to8_clut(info, dst, ddsd->lPitch); - else - blit_8to8(info, dst, ddsd->lPitch); - } else { - ushort *dst = (ushort *)ddsd->lpSurface; - int drow = ddsd->lPitch/2; - - if (bm->type == BMT_FLAT8) { - ushort *pal; - ushort zero_save; - - pal = (flags & TF_ALPHA) ? alpha_pal : texture_pal[bm->align]; - if (pal==NULL) - pal = grd_pal16_list[0]; - - if (flags & TF_TRANS) { - zero_save = pal[0]; - pal[0] = chroma_key; - } - - AssertMsg(pal!=NULL, "Hey! trying to use NULL 16 bit palette to load texture!"); - src = bm->bits; - - if ((info->scale_w|info->scale_h) != 0) - if ((flags & TF_ALPHA)||(texture_clut == NULL)) - blit_8to16_scale(info, dst, drow, pal); - else - blit_8to16_clut_scale(info, dst, drow, pal); - else - if ((flags & TF_ALPHA)||(texture_clut == NULL)) - blit_8to16(info, dst, drow, pal); - else - blit_8to16_clut(info, dst, drow, pal); - - if (flags & TF_TRANS) - pal[0] = zero_save; - - } else { // assume straight 16 to 16 - if ((info->scale_w|info->scale_h) != 0) - blit_16to16_scale(info, dst, drow); - else - blit_16to16(info, dst, drow); - } - } - if (zero_save!=0) - texture_clut[0] = zero_save; -} - -static void GetAvailableTexMem(DWORD *local, DWORD *agp) -{ - DDSCAPS ddscaps; - DWORD total; - - AssertMsg(NULL!=lpdd2, "No DirectDraw object!"); - - if (local!=NULL) { - ddscaps.dwCaps = LOCAL_CAPS; - lpdd2->lpVtbl->GetAvailableVidMem(lpdd2, &ddscaps, &total, local); - } - if (agp!=NULL) { - ddscaps.dwCaps = NONLOCAL_CAPS; - lpdd2->lpVtbl->GetAvailableVidMem(lpdd2, &ddscaps, &total, agp); - } -} - - -static void CookInfo(tdrv_texture_info *info) -{ - d3d_cookie cookie; - int v, w=info->w, h=info->h; - - cookie.hlog = 0; - cookie.wlog = 0; - for (v=2; v<=w; v+=v) - { - cookie.wlog++; - } - for (v=2; v<=h; v+=v) - { - cookie.hlog++; - } - - AssertMsg((info->h == (1<w == (1<flags & TF_ALPHA) - cookie.flags = PF_ALPHA; - else if (info->bm->type == BMT_FLAT16) - cookie.flags = PF_RGB; - else - cookie.flags = PF_GENERIC; - - if (info->flags & TF_TRANS) - cookie.flags |= PF_TRANS; - - if (info->bm->type == BMT_FLAT8) - cookie.palette = info->bm->align; - else - cookie.palette = 0; - - info->cookie = cookie.value; -} - - -static int ReloadTexture(tdrv_texture_info *info) -{ - LPDDPIXELFORMAT pixel_format; - DDSURFACEDESC ddsd; - LPDIRECTDRAWSURFACE SysmemSurface, *pDeviceSurface; - LPD3DITEXTURE SysmemTexture=NULL, *pDeviceTexture; - HRESULT LastError; - d3d_cookie cookie; - - put_mono('b'); - - pDeviceTexture = &Texture[info->id]; - pDeviceSurface = &Surface[info->id]; - - SynchD3D(); - - cookie.value = info->cookie; - pixel_format = FormatList[cookie.flags&PF_MASK]; - - if (pixel_format->dwFlags==0) - // unsupported texture format - return TDRV_FAILURE; - - // Create a surface of the given format using the dimensions of the grs_bitmap - - ZeroMemory(&ddsd, sizeof(ddsd)); - - ddsd.dwSize = sizeof(DDSURFACEDESC); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; - memcpy(&ddsd.ddpfPixelFormat, pixel_format, sizeof(ddsd.ddpfPixelFormat)); - ddsd.dwHeight = info->h; - ddsd.dwWidth = info->w; - - put_mono('c'); - - LastError = CreateSurface(cookie, &ddsd, &SysmemSurface); - CheckHResult(LastError, "CreateSurface() failed"); - AssertMsg(SysmemSurface!=NULL, "NULL SysmemSurface"); - put_mono('h'); - LastError = SysmemSurface->lpVtbl->QueryInterface(SysmemSurface, - &IID_ID3DTexture, - (LPVOID*)&SysmemTexture); - - CheckHResult(LastError, "Failed to obtain D3D texture interface for sysmem surface"); - - ddsd.dwSize = sizeof(DDSURFACEDESC); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; - - - - put_mono('i'); - if (*pDeviceTexture == NULL) { - LPDIRECTDRAWSURFACE DeviceSurface; - - ddsd.ddsCaps.dwCaps = DeviceSurfaceCaps; - LastError = CreateSurface(cookie, &ddsd, pDeviceSurface); - if ((LastError!=DD_OK) && using_local && agp_available) - { - mono_printf(("using nonlocal vidmem textures...\n")); - // try AGP textures... - using_local = FALSE; - DeviceSurfaceCaps = NONLOCAL_CAPS; - ddsd.ddsCaps.dwCaps = DeviceSurfaceCaps; - LastError = CreateSurface(cookie, &ddsd, pDeviceSurface); - } - - if (LastError!=DD_OK) { - mono_printf(("couldn't load texture: error %i.\n", LastError&0xffff)); - SafeRelease(SysmemTexture); - SafeRelease(SysmemSurface); - *pDeviceSurface = NULL; - put_mono('.'); - return TDRV_FAILURE; - } - - DeviceSurface = *pDeviceSurface; - - #define MEMORY_TYPE_MASK \ - (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM|DDSCAPS_NONLOCALVIDMEM) - - if ((DeviceSurfaceCaps&MEMORY_TYPE_MASK) != (ddsd.ddsCaps.dwCaps&MEMORY_TYPE_MASK)) - mono_printf(( - "device texture not created in requested memory location\nRequested %x Received %x\n", - DeviceSurfaceCaps&MEMORY_TYPE_MASK, ddsd.ddsCaps.dwCaps&MEMORY_TYPE_MASK)); - - - // Query our device surface for a texture interface - put_mono('k'); - LastError = DeviceSurface->lpVtbl->QueryInterface(DeviceSurface, - &IID_ID3DTexture, - (LPVOID*)pDeviceTexture); - CheckHResult(LastError, "Failed to obtain D3D texture interface for device surface."); - } - - // Load the bitmap into the sysmem surface - LastError = SysmemSurface->lpVtbl->Lock(SysmemSurface, NULL, &ddsd, 0, NULL); - CheckHResult(LastError, "Failed to lock sysmem surface."); - - LoadSurface(info, &ddsd); - - LastError = SysmemSurface->lpVtbl->Unlock(SysmemSurface, NULL); - CheckHResult(LastError, "Failed to unlock sysmem surface."); - - // Load the sysmem texture into the device texture. During this call, a - // driver could compress or reformat the texture surface and put it in - // video memory. - - put_mono('l'); - LastError = pDeviceTexture[0]->lpVtbl->Load(pDeviceTexture[0], SysmemTexture); - CheckHResult(LastError, "Failed to load device texture from sysmem texture."); - - // Now we are done with sysmem surface - - put_mono('m'); - SafeRelease(SysmemTexture); - put_mono('n'); - SafeRelease(SysmemSurface); - - TdrvBitmap[info->id] = info->bm; - - put_mono('.'); - return TDRV_SUCCESS; -} - -static int doLoad(tdrv_texture_info *info) -{ - HRESULT LastError; - int result; - int n = info->id; - - result = ReloadTexture(info); - if (result != TDRV_SUCCESS) - return result; - - put_mono('o'); - LastError = Texture[n]->lpVtbl->GetHandle(Texture[n], lpd3dDevice, &TextureHandle[n]); - - if (LastError!=DD_OK) { - mono_printf(("GetTextureHandle failed! facility %i error %i width %i height %i\n", - (LastError>>16)&0x7fff, LastError&0xffff, info->w, info->h)); - SafeRelease(Texture[n]); - SafeRelease(Surface[n]); - put_mono('.'); - return TDRV_FAILURE; - } - - return TDRV_SUCCESS; -} - - -static int LoadTexture(tdrv_texture_info *info) -{ - int n = info->id; - DWORD local_start=0, agp_start=0; - int result; - - put_mono('a'); - -#if 0 - if ((info->h < device_desc->dwMinTextureHeight) || - (info->h > device_desc->dwMaxTextureHeight) || - (info->w < device_desc->dwMinTextureWidth) || - (info->w > device_desc->dwMaxTextureWidth)) - return TDRV_FAILURE; -#endif - if ((texture_caps & D3DPTEXTURECAPS_SQUAREONLY) && (info->w != info->h)) { - put_mono('.'); - return TDRV_FAILURE; - } - - GetAvailableTexMem( - local_available ? &local_start : NULL, - agp_available ? &agp_start : NULL); - - if ((local_start < info->size) && using_local && agp_available) - { // switch to agp and try again... - mono_printf(("using nonlocal vidmem textures...\n")); - - using_local = FALSE; - DeviceSurfaceCaps = NONLOCAL_CAPS; - } - - if ((using_local ? local_start : agp_start) < info->size) - { - put_mono('.'); - return TDRV_FAILURE; - } - - AssertMsg((n>=0)&&(nsize == 0) { - DWORD local_end, agp_end; - - // calculate size - GetAvailableTexMem( - local_available ? &local_end : NULL, - agp_available ? &agp_end : NULL); - - if (local_available && (local_start > local_end)) - { - AssertMsg( (!agp_available)||(agp_start==agp_end), - "Texture load modified local and nonlocal vidmem!"); - info->size = local_start - local_end; - } else { - AssertMsg(agp_available && (agp_start > agp_end), - "Texture load took no space!"); - info->size = agp_start - agp_end; - } - } - - put_mono('.'); - return TDRV_SUCCESS; -} - -static void CheckSurfaces(sWinDispDevCallbackInfo *info) -{ - static void (*chain)(sWinDispDevCallbackInfo *); - int i; - - switch (info->message) { - case kWinDispDevCallbackActive: - for (i=0; ilpVtbl->IsLost(lpTS) != DDERR_SURFACELOST)) - continue; - - VerifyMsg(lpTS->lpVtbl->Restore(lpTS)==DD_OK, "Could not restore lost surface!"); - if (TdrvBitmap[i]!=NULL) { - AssertMsg(g_tmgr != NULL, "Hmmm. Should have a non-NULL texture manager here."); - g_tmgr->unload_texture(TdrvBitmap[i]); - } - } - break; - case kWinDispDevCallbackUpdateChain: - GenericCallbackChainHandler(&callback_id, (callback_chain_func **)&chain, (callback_chain_info *)info); - return; - } - if (chain!=NULL) - chain(info); -} - -extern void UnsetTextureId(int n); -// Disconnect texture from bitmap, but don't release texture yet -static void UnloadTexture(int n) -{ - AssertMsg((n>=0)&&(n=0)&&(nlpVtbl->GetCaps(Surface[n], &ddscaps); - if (ddscaps.dwCaps & DDSCAPS_LOCALVIDMEM) - { - mono_printf(("Using Local vidmem textures\n")); - DeviceSurfaceCaps = LOCAL_CAPS; - using_local = TRUE; - } - } - - SafeRelease(Material[n]); - SafeRelease(Texture[n]); - SafeRelease(Surface[n]); - MaterialHandle[n]=0; - TextureHandle[n]=0; - TdrvBitmap[n] = NULL; -} - -void SynchD3D(void) -{ -#ifndef SHIP - HRESULT hRes = -#endif - lpd3dDevice->lpVtbl->SetRenderState(lpd3dDevice, - D3DRENDERSTATE_FLUSHBATCH, 0); - CheckHResult(hRes, "FlushBatch failed"); -} diff --git a/libsrc/lgd3d/texture.h b/libsrc/lgd3d/texture.h deleted file mode 100644 index 10c732f..0000000 --- a/libsrc/lgd3d/texture.h +++ /dev/null @@ -1,16 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/texture.h 1.6 1998/02/02 12:52:06 KEVIN Exp $ - -#ifndef __TEXTURE_H -#define __TEXTURE_H - -extern D3DTEXTUREHANDLE TextureHandle[]; -extern D3DMATERIALHANDLE MaterialHandle[]; -extern grs_bitmap *TdrvBitmap[]; - -typedef struct lgd3ds_device_info lgd3ds_device_info; -extern void InitTextureSys(lgd3ds_device_info *info); -extern void ShutdownTextureSys(void); - -#define LGD3D_MAX_TEXTURES 1024 - -#endif diff --git a/libsrc/lgd3d/tmgr.c b/libsrc/lgd3d/tmgr.c deleted file mode 100644 index fb7375f..0000000 --- a/libsrc/lgd3d/tmgr.c +++ /dev/null @@ -1,771 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/tmgr.c 1.33 1998/06/30 18:36:56 buzzard Exp $ -#include - -#include -#include -#include -#include -#include - -#ifndef SHIP -#include -static BOOL spew; -#define mono_printf(x) \ -do { \ - if (spew) \ - mprintf x ; \ -} while (0) -#else -#define mono_printf(x) -#endif - -#include -#include - -#ifdef MONO_SPEW -#define put_mono(c) \ -do { \ - uchar *p_mono = (uchar *)0xb0082; \ - *p_mono = c; \ -} while (0) -#else -#define put_mono(c) -#endif - -static int tmgr_init(r3s_texture bm, int max_textures, int* texture_size_list, int num_texture_sizes, int flags); -static void tmgr_shutdown(void); -static void tmgr_start_frame(int f); -static void tmgr_end_frame(void); -static void tmgr_load_texture(r3s_texture bm); -static void tmgr_unload_texture(r3s_texture bm); -static void tmgr_reload_texture(r3s_texture bm); -static void tmgr_set_texture(r3s_texture bm); -static void tmgr_set_texture_callback(void); -static void tmgr_stats(void); -static uint tmgr_bytes_loaded(void); -static BOOL tmgr_get_utilization(float *utilization); -static uchar *tmgr_set_clut(uchar *); -static void tmgr_restore_bits(grs_bitmap *bm); - -static texture_driver *g_driver; -static texture_manager tmgr; - -// Look! it's our one and only export! -texture_manager *get_dopey_texture_manager(texture_driver *driver) -{ - g_driver = driver; - tmgr.init = tmgr_init; - tmgr.shutdown = tmgr_shutdown; - tmgr.start_frame = tmgr_start_frame; - tmgr.end_frame = tmgr_end_frame; - tmgr.load_texture = tmgr_load_texture; - tmgr.unload_texture = tmgr_unload_texture; - tmgr.set_texture = tmgr_set_texture; - tmgr.set_texture_callback = tmgr_set_texture_callback; - tmgr.stats = tmgr_stats; - tmgr.bytes_loaded = tmgr_bytes_loaded; - tmgr.get_utilization = tmgr_get_utilization; - tmgr.set_clut = tmgr_set_clut; - tmgr.restore_bits = tmgr_restore_bits; - tmgr.reload_texture = tmgr_reload_texture; - return &tmgr; -} - - -#define BMF_HACK 0x80 -#define TMGR_UNLOADED (-1) - -typedef struct tmgr_texture_info tmgr_texture_info; - -struct tmgr_texture_info { - grs_bitmap *bitmap; // back ptr to bitmap - uchar *bits; // bits ptr from bitmap - int frame; // frame last used - uchar *clut; // ptr to clut used when loaded - int next; // index of next texture of this size - int size; - ulong cookie; // cookie from tmgr. Can reload when these match! -}; - -typedef struct tmap_chain { - int size; - int head; -} tmap_chain; - -static tmgr_texture_info *texinfo = NULL; -static tmap_chain *chain_list = NULL; -static int num_texture_sizes = 0; - -static uchar *texture_clut; -static r3s_texture default_bm; -static r3s_texture callback_bm; - -static int cur_frame; -static int max_textures; -static int next_id; -static uint bytes_loaded; // bytes loaded this frame -static uint texmem_used; -static uint texmem_loaded; - -static BOOL swapout = FALSE; -static BOOL overloaded = FALSE; -static BOOL in_frame = FALSE; - - -// returns old clut -static uchar *tmgr_set_clut(uchar *clut) -{ - uchar *retval = texture_clut; - texture_clut = clut; - return retval; -} - -// return amount of texture memory loaded this frame -static uint tmgr_bytes_loaded(void) -{ - return bytes_loaded; -} - -static BOOL tmgr_get_utilization(float *utilization) -{ - if (overloaded) { // we're really overutilized - *utilization = 1.0; - return TRUE; - } - - if (!swapout) - // we're not loaded to capacity yet; stats wouldn't be valid - return FALSE; - - *utilization = ((float )texmem_used)/texmem_loaded; - return TRUE; -} - -const char *bad_bm_string = "Bitmap data out of synch."; - -#define is_valid(bm) \ - ((bm != NULL) && \ - ((uint )bm->bits < (uint )max_textures) && \ - (bm == texinfo[(uint )bm->bits].bitmap)) - -#define validate_bm(bm) AssertMsg(is_valid(bm), bad_bm_string) - -static void tmgr_restore_bits(grs_bitmap *bm) -{ - if ((bm == NULL)||((bm->flags&BMF_LOADED)==0)) - return; - validate_bm(bm); - bm->bits = texinfo[(uint )bm->bits].bits; -} - -// eliminate bitmap pointer from list, mark -// vidmem as ready to be released. -static void do_unload(grs_bitmap *bm) -{ - int i; - tmgr_texture_info *info; - - validate_bm(bm); - - i = (int )bm->bits; - info = &texinfo[i]; - - bm->flags &= ~BMF_LOADED; - bm->bits = info->bits; - info->bitmap = NULL; - info->frame = TMGR_UNLOADED; - - // tell driver to disconnect bitmap from texture - g_driver->unload_texture(i); -} - - -// really for sure get rid of this texture -static void release_texture(int i) -{ - tmgr_texture_info *info = &texinfo[i]; - grs_bitmap *bm = info->bitmap; - if (bm!=NULL) - do_unload(bm); - info->frame = 0; - if (info->bits!=NULL) { - g_driver->release_texture(i); - info->bits = NULL; - texmem_loaded -= info->size; - } -} - -static void set_flags(tdrv_texture_info *info) -{ - info->flags = 0; - if (gr_get_fill_type() == FILL_BLEND) { - info->flags |= TF_ALPHA; - } - - if ((!(info->flags&TF_ALPHA)) && (info->bm->flags&BMF_TRANS)) { - info->flags |= TF_TRANS; - } - - if (info->bm->flags & BMF_LOADED) - info->bits = texinfo[info->id].bits; - else - info->bits = info->bm->bits; -} - - -#define TMGR_SUCCESS 0 -static int do_load(tdrv_texture_info *info) -{ - grs_bitmap *bm = info->bm; - tmgr_texture_info *tmgr_info = &texinfo[info->id]; - - AssertMsg((!swapout)||(tmgr_info->size == info->size), "do_load(): size mismatch."); - - if (tmgr_info->bits != NULL) { - - AssertMsg(info->cookie == tmgr_info->cookie, - "do_load(): cookie doesn't match original."); - - g_driver->reload_texture(info); - } else { - if (g_driver->load_texture(info) == TDRV_FAILURE) - return TMGR_FAILURE; - texmem_loaded += info->size; - } - bytes_loaded += info->size; - tmgr_info->clut = texture_clut; - tmgr_info->bits = bm->bits; - tmgr_info->bitmap = bm; - tmgr_info->cookie = info->cookie; - tmgr_info->size = info->size; - bm->bits = (uchar *)info->id; - bm->flags |= BMF_LOADED; - - return TMGR_SUCCESS; -} - -static void init_bitmap_list(void) -{ - int i; - tmgr_texture_info *tmgr_info = texinfo; - - for (i=0; ibitmap = NULL; - tmgr_info->bits = NULL; - tmgr_info->frame = 0; - tmgr_info->size = 0; - tmgr_info->clut = NULL; - tmgr_info++; - } -} - -static void do_set_texture(r3s_texture bm) -{ - int i; - tmgr_texture_info *info; - - if (bm->flags & BMF_HACK) { - if (!(default_bm->flags&BMF_LOADED)) - tmgr_load_texture(default_bm); - do_set_texture(default_bm); - return; - } - - validate_bm(bm); - - i = (int )bm->bits; - info = &texinfo[i]; - - if (info->frame != cur_frame) { - texmem_used += info->size; - info->frame = cur_frame; - } - g_driver->set_texture_id(i); -} - -#define TMGR_INVALID_TEXTURE_SIZE ((tmap_chain *)-1) -#define MAX_SIZE 9 -static tmap_chain *alpha_size_table[MAX_SIZE*MAX_SIZE]; -static tmap_chain *norm8_size_table[MAX_SIZE*MAX_SIZE]; -static tmap_chain *norm16_size_table[MAX_SIZE*MAX_SIZE]; - -static tmap_chain *calc_size(tdrv_texture_info *info) -{ - int i,j,w,h; - tmap_chain **size_table; - tmap_chain *chain; - grs_bitmap *bm = info->bm; - - set_flags(info); - info->scale_w = info->scale_h = 0; - - - if (info->flags & TF_ALPHA) - size_table = alpha_size_table; - else if (bm->type == BMT_FLAT8) - size_table = norm8_size_table; - else - size_table = norm16_size_table; - - - for (i=0, w=1; iw) break; - for (j=0, h=1; jh) break; - - if ((i>=MAX_SIZE)||(j>=MAX_SIZE)) { - mono_printf(("Unsupported texture size: w=%i h=%i\n", bm->w, bm->h)); - bm->flags|=BMF_HACK; - } - - else while ((chain = size_table[i*MAX_SIZE+j])==NULL) - { - if (iscale_w++; - } else { - j++, info->scale_h++; - if (jw, bm->h)); - bm->flags|=BMF_HACK; - break; - } - } - if (chain!=NULL) - info->size = chain->size; - - info->w = bm->w << info->scale_w; - info->h = bm->h << info->scale_h; - return chain; -} - - -static void init_size_table(tmap_chain **size_table, int type) -{ - int i, j; - int w, h; - tdrv_texture_info info; - info.id = 0; - - for (i=0,w=1; iw; - info.h = info.bm->h; - info.size = 0; - g_driver->cook_info(&info); - if (g_driver->load_texture(&info) == TDRV_FAILURE) - { // can't load this size texture - size_table[i + j] = TMGR_INVALID_TEXTURE_SIZE; - } else { - size_table[i + j] = (tmap_chain *)info.size; - g_driver->release_texture(info.id); - } - gr_free(info.bm); - } - } -} - -#define MAX_TMAP_SIZES 3*MAX_SIZE*MAX_SIZE - -// here we're just trying to figure out how many distinct texture sizes there are... -static int get_num_sizes(tmap_chain **size_list, int num_sizes, tmap_chain **size_table) -{ - int i,j; - for (i=0; iend_frame(); - - g_driver->synchronize(); - - for (i=0; istart_frame(cur_frame); - - overloaded = TRUE; - - // reset all the size chains - for (i=0; ihead; i>=0; i=tmgr_info->next) { - int frame; - - tmgr_info = &texinfo[i]; - - AssertMsg(info->size == texinfo[i].size, "wrong size!"); - // old enough? - frame = tmgr_info->frame; - - if (frame >= cur_frame-1) - continue; - - if (reload && (info->cookie != tmgr_info->cookie)) - continue; - - if ((!reload) && (info->cookie == tmgr_info->cookie)) - reload = TRUE; - else if (frame >= min_frame) - continue; - - min_frame = frame; - n = i; - if (reload && (min_frame==TMGR_UNLOADED)) - // can't do better than this! - break; - } - - // if we're not in swapout mode, we only want to reload unloaded textures - if ((!swapout) && ((!reload) || (min_frame != TMGR_UNLOADED))) { - info->id = next_id; - return; - } - - if (n==-1) { // can't find suitable swapout; dump everything! - mono_printf(("Can't find suitable swapout candidate; dumping all textures!\n")); - - dump_all_textures(); - info->id = next_id; - } else { - if (!reload) - release_texture(n); - else if (texinfo[n].bitmap != NULL) - do_unload(texinfo[n].bitmap); - - info->id = n; - } -} - - -static void tmgr_unload_texture(r3s_texture bm) -{ - put_mono('e'); - if ((bm->flags&BMF_LOADED)==0) { - put_mono('.'); - return; - } - - if (is_valid(bm)) { - // synch now in case we want to swap out this texture later this frame... - g_driver->synchronize(); - do_unload(bm); - } else - Warning(("bad bitmap pointer for unload!\n")); - - put_mono('.'); -} - -static void tmgr_reload_texture(r3s_texture bm) -{ - tdrv_texture_info info; - - if ((bm == NULL)||((bm->flags&BMF_LOADED)==0)) { - Warning(("tmgr_reload_texture(): NULL bitmap or bitmap not loaded.\n")); - return; - } - - validate_bm(bm); - info.bm = bm; - info.id = (int )bm->bits; - - calc_size(&info); - g_driver->cook_info(&info); - - AssertMsg(info.cookie == texinfo[info.id].cookie, - "tmgr_reload_texture(): cookie doesn't match original."); - - g_driver->reload_texture(&info); -} - -static void tmgr_load_texture(r3s_texture bm) -{ - tdrv_texture_info info; - tmap_chain *chain; - - put_mono('d'); - - if (bm->flags & BMF_LOADED) - { // must have meant _re_load ;) - tmgr_reload_texture(bm); - return; - } - - info.bm = bm; - - chain = calc_size(&info); - - if (bm->flags & BMF_HACK) - return; - - g_driver->cook_info(&info); - - swapout_bitmap(&info, chain); - - do { - put_mono('1'); - if (do_load(&info)!=TDRV_FAILURE) - break; - - if (swapout) { - put_mono('2'); - mono_printf(("swapout _really_ failed; dumping all textures!")); - dump_all_textures(); - info.id = next_id; - } else { - put_mono('3'); - mono_printf(("Out of texture memory; entring swapout mode.\n")); - swapout = TRUE; - swapout_bitmap(&info, chain); - } - } while (TRUE); - - put_mono('4'); - if ((!swapout)&&(info.id==next_id)) { - // add new texture to head of chain... - texinfo[next_id].next = chain->head; - chain->head = next_id; - AssertMsg(texinfo[next_id].size == chain->size, "wrong size!"); - - if (++next_id == max_textures) { - mono_printf(("Out of texture handles; entering swapout mode.\n")); - swapout = TRUE; - } - } - put_mono('.'); -} - -static void tmgr_set_texture(r3s_texture bm) -{ - put_mono('f'); - if (bm==NULL) { - g_driver->set_texture_id(TDRV_ID_SOLID); - put_mono('.'); - return; - } - if (bm->flags & BMF_LOADED) { - validate_bm(bm); - if (texture_clut == texinfo[(int )bm->bits].clut) { - do_set_texture(bm); - put_mono('.'); - return; - } - mono_printf(("unloading to resynch with new texture clut!\n")); - tmgr_unload_texture(bm); - put_mono('f'); - } - callback_bm = bm; - g_driver->set_texture_id(TDRV_ID_CALLBACK); - put_mono('.'); -} - -static void tmgr_set_texture_callback(void) -{ - put_mono('g'); - AssertMsg(callback_bm!=NULL, "can't load NULL bitmap!\n"); - tmgr_load_texture(callback_bm); - put_mono('g'); - do_set_texture(callback_bm); - put_mono('.'); -} - -static void tmgr_start_frame(int frame) -{ - static uint abl = 0; - put_mono('c'); - if (frame != cur_frame) { - cur_frame = frame; - overloaded = FALSE; - abl = (abl*7 + bytes_loaded)/8; - if ((frame & 0xf) == 0) - mono_printf(("avg bytes downloaded per frame: %i \n", abl)); - bytes_loaded = 0; - texmem_used = 0; - } - in_frame = TRUE; - put_mono('.'); -} - -static void tmgr_end_frame(void) -{ - in_frame = FALSE; -} - -static int tmgr_init(r3s_texture bm, int in_max_textures, int *texture_size_list, int num_texture_sizes, int flags) -{ - if (texinfo!=NULL) - tmgr_shutdown(); - -#ifndef SHIP - spew = ((flags & TMGRF_SPEW) != 0); -#endif - - put_mono('a'); - bytes_loaded = 0; - texmem_loaded = 0; - max_textures = in_max_textures; - texinfo = (tmgr_texture_info *)Malloc(in_max_textures * sizeof(*texinfo)); - init_bitmap_list(); - init_size_tables(); - default_bm = bm; - swapout = FALSE; - overloaded = FALSE; - in_frame = FALSE; - texture_clut = NULL; - next_id = 0; - put_mono('.'); - return TMGR_SUCCESS; -} - -static void tmgr_shutdown(void) -{ - if (texinfo == NULL) - return; - - put_mono('b'); - dump_all_textures(); - - Free(texinfo); - texinfo = NULL; - - if (chain_list != NULL) { - Free(chain_list); - chain_list = NULL; - } - - put_mono('.'); -} - - - - -#ifndef SHIP - -static void tmgr_stats(void) -{ - int i, current_total=0, global_total=0; - - mono_setxy(0,0); - mprint("Texture Manager Stats: \n"); - mprintf("texmem_loaded: %i texmem_used: %i swapout: %i \n", - texmem_loaded, texmem_used, swapout); - for (i = 0; i= 0) - { - AssertMsg(size == texinfo[index].size, "wrong size!"); - if (texinfo[index].bits != NULL) { - total++; - if (texinfo[index].frame == cur_frame) - current++; - } - index = texinfo[index].next; - } - if (total > 0) { - mprintf("size %i: this frame: %i total: %i \n", - size, current, total); - current_total += current*size; - global_total += total*size; - } - } - mprintf("checksum: \n"); - mprintf("texmem_loaded: %i texmem_used: %i \n", - global_total, current_total); - AssertMsg(global_total==texmem_loaded, "stats incorrect!"); -} -#else -static void tmgr_stats(void) {} -#endif - diff --git a/libsrc/lgd3d/tmgr.h b/libsrc/lgd3d/tmgr.h deleted file mode 100644 index 5e4891e..0000000 --- a/libsrc/lgd3d/tmgr.h +++ /dev/null @@ -1,50 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/tmgr.h 1.18 1998/09/18 16:13:05 KEVIN Exp $ -#ifndef __TMGR_H -#define __TMGR_H -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct grs_bitmap grs_bitmap; - -#define TMGR_SUCCESS 0 -#define TMGR_FAILURE -1 -#define BMF_LOADED 0x40 - -#define TMGRF_SPEW 1 - -typedef struct texture_manager { - int (*init)(grs_bitmap *bm, int max_textures, int *texture_size_list, int num_texture_sizes, int flags); - void (*shutdown)(void); - void (*start_frame)(int frame); - void (*end_frame)(void); - void (*load_texture)(grs_bitmap *bm); - void (*unload_texture)(grs_bitmap *bm); - void (*set_texture)(grs_bitmap *bm); - void (*set_texture_callback)(void); - void (*stats)(void); // spew stats to the mono screen - uint (*bytes_loaded)(void); // bytes downloaded this frame - BOOL (*get_utilization)(float *utilization); - uchar *(*set_clut)(uchar *clut); - void (*restore_bits)(grs_bitmap *bm); - void (*reload_texture)(grs_bitmap *bm); -} texture_manager; - -/* -typedef struct texture_driver texture_driver; - -extern texture_manager *get_block_texture_manager(texture_driver *driver); -extern texture_manager *get_dopey_texture_manager(texture_driver *driver); -//*/ - -//zb -extern texture_manager *get_block_texture_manager( void* driver ); -extern texture_manager *get_dopey_texture_manager( void* driver ); - - -extern texture_manager *g_tmgr; // this is kinda silly, but it'll do for now... - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libsrc/lgd3d/tmgrold.c b/libsrc/lgd3d/tmgrold.c deleted file mode 100644 index dc90631..0000000 --- a/libsrc/lgd3d/tmgrold.c +++ /dev/null @@ -1,548 +0,0 @@ -// $Header: x:/prj/tech/libsrc/lgd3d/RCS/tmgrold.c 1.20 1997/11/10 23:48:38 KEVIN Exp $ -#include - -#include -#include -#include -#include -#include - -#ifndef SHIP -#include -#define mono_printf(x) mprintf x -#else -#define mono_printf(x) -#endif - -#include -#include - -#ifdef MONO_SPEW -#define put_mono(c) \ -do { \ - uchar *p_mono = (uchar *)0xb0082; \ - *p_mono = c; \ -} while (0) -#else -#define put_mono(c) -#endif - -static int tmgr_init(r3s_texture bm, int num_entries); -static void tmgr_shutdown(void); -static void tmgr_start_frame(int f); -static void tmgr_load_texture(r3s_texture bm); -static void tmgr_unload_texture(r3s_texture bm); -static void tmgr_set_texture(r3s_texture bm); -static void tmgr_set_texture_callback(void); -static void tmgr_stats(void); -static uint tmgr_bytes_loaded(void); - -static texture_driver *g_driver; -static texture_manager tmgr; - -// Look! it's our one and only export! -texture_manager *get_dopey_texture_manager(texture_driver *driver) -{ - g_driver = driver; - tmgr.init = tmgr_init; - tmgr.shutdown = tmgr_shutdown; - tmgr.start_frame = tmgr_start_frame; - tmgr.load_texture = tmgr_load_texture; - tmgr.unload_texture = tmgr_unload_texture; - tmgr.set_texture = tmgr_set_texture; - tmgr.set_texture_callback = tmgr_set_texture_callback; - tmgr.stats = tmgr_stats; - tmgr.bytes_loaded = tmgr_bytes_loaded; - return &tmgr; -} - - -#define BMF_HACK 0x80 -#define TMGR_UNLOADED (-1) - -static r3s_texture default_bm; -static r3s_texture callback_bm; -static grs_bitmap **bitmap=NULL; -static uchar **bits=NULL; -static int *frame; -static int *size; -static int cur_frame; -static int max_textures; -static int next_id; -static uint bytes_loaded; - -static BOOL swapout = FALSE; -static BOOL flushing = FALSE; - - -// return amount of texture memory loaded this frame -static uint tmgr_bytes_loaded(void) -{ - return bytes_loaded; -} - -const char *bad_bm_string = "Bitmap data out of synch."; - -#define is_valid(bm) \ - (((uint )bm->bits < (uint )max_textures) && (bm == bitmap[(uint )bm->bits])) - -#define validate_bm(bm) AssertMsg(is_valid(bm), bad_bm_string) - -// eliminate bitmap pointer from list, mark -// vidmem as ready to be released. -static void do_unload(grs_bitmap *bm) -{ - int i = (int )bm->bits; - validate_bm(bm); - bm->flags &= ~BMF_LOADED; - bm->bits = bits[i]; - bitmap[i] = NULL; - frame[i] = TMGR_UNLOADED; - if (bm->flags&BMF_HACK) - // indicate this entry was hacked so we don't try to swap or release it later. - bits[i] = NULL; - else - // tell driver to disconnect bitmap from texture - g_driver->unload_texture(i); - -} - -// really for sure get rid of this texture -static void release_texture(int i) -{ - grs_bitmap *bm = bitmap[i]; - if (bm!=NULL) - do_unload(bm); - frame[i] = 0; - if (bits[i]!=NULL) { - g_driver->release_texture(i); - bits[i] = NULL; - } -} - -#define TMGR_SUCCESS 0 -static int do_load(int i, grs_bitmap *bm, int s) -{ - if (!(bm->flags & BMF_HACK)) - { - if (g_driver->load_texture(i, bm) == TDRV_FAILURE) - return TMGR_FAILURE; - bytes_loaded += s; - } - bits[i] = bm->bits; - bitmap[i] = bm; - size[i] = s; - bm->bits = (uchar *)i; - bm->flags |= BMF_LOADED; - - return TMGR_SUCCESS; -} - -static void init_bitmap_list(void) -{ - int i; - for (i=0; ibits; - frame[n] = cur_frame; - if (bm->flags & BMF_HACK) { - if (!(default_bm->flags&BMF_LOADED)) - tmgr_load_texture(default_bm); - do_set_texture(default_bm); - return; - } - - g_driver->set_texture_id(n); -} - -#define TMGR_INVALID_TEXTURE_SIZE -1 - -#define MAX_SIZE 9 -static int alpha_size_table[MAX_SIZE*MAX_SIZE]; -static int norm_size_table[MAX_SIZE*MAX_SIZE]; - -static int calc_size(grs_bitmap *bm) -{ - int i,j,w,h; - int *size_table; - - if (gr_get_fill_type() == FILL_BLEND) - size_table = alpha_size_table; - else - size_table = norm_size_table; - - - for (i=0, w=1; iw) break; - for (j=0, h=1; jh) break; - if ((i>=MAX_SIZE)||(j>=MAX_SIZE)|| - (size_table[i*MAX_SIZE+j]==TMGR_INVALID_TEXTURE_SIZE)) - { - mono_printf(("Unsupported texture size: w=%i h=%i\n", bm->w, bm->h)); - bm->flags|=BMF_HACK; - return bm->w*bm->h; - } - return size_table[i*MAX_SIZE+j]; -} - - -static int init_size_table(int *size_table) -{ - int i, j; - int w, h; - for (i=0,w=1; iload_texture(0, bm); - if (result == TDRV_FAILURE) { // can't load this size texture - size_table[i*MAX_SIZE + j] = TMGR_INVALID_TEXTURE_SIZE; - } else { - int size = g_driver->release_texture(0)-result; - size_table[i*MAX_SIZE + j] = size; - } - gr_free(bm); - } - } - return TMGR_SUCCESS; -} - -static int init_size_tables(void) -{ - int result; - - gr_set_fill_type(FILL_BLEND); - result = init_size_table(alpha_size_table); - gr_set_fill_type(FILL_NORM); - - if (result==TMGR_SUCCESS) - result = init_size_table(norm_size_table); - - return result; -} - -static void dump_all_unused_textures(void) -{ - int i; - flushing = TRUE; - swapout = FALSE; - next_id = 0; - put_mono('!'); - for (i=0; iflags & BMF_HACK))) { - if (bm_size!=0) - continue; - // swap out hacked texture! - n = i; - break; - } - // old enough? - age = cur_frame - frame[i]; - if (age <= max_age) - continue; - - max_age = age; - n = i; - } - - if (n==-1) { // can't find suitable swapout; dump everything! - mono_printf(("Can't find suitable swapout candidate; dumping all unused textures!\n")); - - - // yo yo yo synch everything pending... - // hopefully this prevents crashes and other weirdness - g_driver->synchronize(); - dump_all_unused_textures(); - } else { - release_texture(n); - next_id = n; - } -} - - -static void tmgr_unload_texture(r3s_texture bm) -{ - put_mono('e'); - if ((bm->flags&BMF_LOADED)==0) { - put_mono('.'); - return; - } - - if (is_valid(bm)) { - g_driver->synchronize(); - if (flushing) - release_texture((int )bm->bits); - else - do_unload(bm); - } else - Warning(("bad bitmap pointer for unload!\n")); - - put_mono('.'); -} - -static void tmgr_load_texture(r3s_texture bm) -{ - int size; - - put_mono('d'); - size = calc_size(bm); - - if (swapout) - swapout_bitmap(bm->flags&BMF_HACK ? 0 : size); - - - do { - while (flushing && (frame[next_id]==cur_frame)) - if (++next_id == max_textures) { - mono_printf(("Out of texture handles while in flush mode. I hate life.")); - g_driver->synchronize(); - dump_all_textures(); - } - - AssertMsg((next_id < max_textures) && (bitmap[next_id] == NULL) && (bits[next_id] == NULL), - "Hmmm. this really shouldn't happen...\n"); - - if (do_load(next_id, bm, size)!=TDRV_FAILURE) - break; - - if (swapout) { - mono_printf(("swapout _really_ failed; dumping all unused textures!")); - - // yo yo yo synch everything pending... - // hopefully this prevents crashes. - g_driver->synchronize(); - dump_all_unused_textures(); - } else if (flushing) { - mono_printf(("Out of texture memory while in flush mode. I really hate life.")); - g_driver->synchronize(); - dump_all_textures(); - } else { - mono_printf(("Out of texture memory; entring swapout mode.\n")); - swapout = TRUE; - swapout_bitmap(size); - } - } while (TRUE); - if ((!swapout)&&(!flushing)&& - (++next_id == max_textures)) { - mono_printf(("Out of texture handles; entering swapout mode.\n")); - swapout = TRUE; - } - put_mono('.'); -} - -static void tmgr_set_texture(r3s_texture bm) -{ - put_mono('f'); - if (bm==NULL) { - g_driver->set_texture_id(TDRV_ID_SOLID); - put_mono('.'); - return; - } - if (bm->flags & BMF_LOADED) { - do_set_texture(bm); - put_mono('.'); - return; - } - callback_bm = bm; - g_driver->set_texture_id(TDRV_ID_CALLBACK); - put_mono('.'); -} - -static void tmgr_set_texture_callback(void) -{ - put_mono('g'); - AssertMsg(callback_bm!=NULL, "can't load NULL bitmap!\n"); - tmgr_load_texture(callback_bm); - put_mono('g'); - do_set_texture(callback_bm); - put_mono('.'); -} - -static void tmgr_start_frame(int frame) -{ - static uint abl = 0; - put_mono('c'); - if (frame != cur_frame) { - cur_frame = frame; - abl = (abl*7 + bytes_loaded)/8; - if ((frame & 0xf) == 0) - mono_printf(("avg bytes downloaded per frame: %i\n", abl)); - bytes_loaded = 0; - if (flushing) { - mono_printf(("completing flush...\n")); - g_driver->synchronize(); - dump_all_textures(); - } - } - - tmgr_set_texture(default_bm); - put_mono('.'); -} - -static int tmgr_init(r3s_texture bm, int num_textures) -{ - if (bitmap!=NULL) - tmgr_shutdown(); - - put_mono('a'); - - bytes_loaded = 0; - max_textures = num_textures; - bitmap = (grs_bitmap **)Malloc(num_textures * (sizeof(*bitmap) + sizeof(*frame) + - sizeof(*size) + sizeof(*bits))); - frame = (int *)(&bitmap[num_textures]); - size = (int *)(&frame[num_textures]); - bits = (uchar **)(&size[num_textures]); - init_bitmap_list(); - init_size_tables(); - default_bm = bm; - swapout = FALSE; - next_id = 0; - put_mono('.'); - return TMGR_SUCCESS; -} - -static void tmgr_shutdown(void) -{ - if (bitmap == NULL) - return; - - put_mono('b'); - dump_all_textures(); - - Free(bitmap); - - bitmap = NULL; - put_mono('.'); -} - - - - -#ifndef SHIP - -#define STATINFO_NUM_SIZES 20 - -typedef struct { - int size; - int real; - int fake; -} tmgr_stat_info; - -static tmgr_stat_info statinfo[STATINFO_NUM_SIZES]; - -static void clear_stats(void) -{ - int i; - for (i=0; iflags & BMF_HACK) - faked += s; - else - real += s; - for (j=0; jflags&BMF_HACK) { - statinfo[j].real = 0; - statinfo[j].fake = 1; - } else { - statinfo[j].real = 1; - statinfo[j].fake = 0; - } - break; - } - if (statinfo[j].size == s) { - if (bm->flags&BMF_HACK) - statinfo[j].fake++; - else - statinfo[j].real++; - break; - } - } - if (j==STATINFO_NUM_SIZES) - Warning(("Too few stat texture sizes available.\n")); - } - mono_setxy(0,0); - mprint("Texture Manager Stats: \n"); - mprintf("total faked: %i total real: %i combined: %i \n", - faked, real, faked+real); - for (i=0; i Date: Fri, 21 Jun 2024 01:41:17 +0300 Subject: [PATCH 02/35] update from local. d6sts_s.cpp --- libsrc/lgd3d/d6sts_s.cpp | 975 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 974 insertions(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 60fe211..128d18d 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -1,6 +1,36 @@ +#include +#include +#include +#include +#include +#include +#include + +BOOL lgd3d_blend_trans = TRUE; + +#ifndef SHIP +#define mono_printf(x) \ + if (bSpewOn) \ + mprintf x; +#else +#define mono_printf(x) +#endif + +// #include "d3dmacs.h" #include "d6States.h" -#include +#include +#include + + +#ifndef SHIP +static const char* hResErrorMsg = "%s:\nFacility %i, Error %i"; +#endif +static char* pcDXef = (char*)"%s: error %d\n%s"; +static char* pcLGD3Def = (char*)"LGD3D error no %d : %s : message: %d\n%s"; + +#define CheckHResult(hRes, msg) \ +AssertMsg3(hRes==0, hResErrorMsg, msg, (hRes>>16)&0x7fff, hRes&0xffff) class cImStates : public cD6States { @@ -45,6 +75,58 @@ class cMSStates : public cD6States { virtual void TurnOffTexuring(bool bTexOff) override; }; +DDPIXELFORMAT* g_FormatList[5]; + +sTextureData g_saTextures[LGD3D_MAX_TEXTURES]; + +DDPIXELFORMAT g_RGBTextureFormat; + +DDPIXELFORMAT g_TransRGBTextureFormat, g_PalTextureFormat, g_AlphaTextureFormat, g_8888TexFormat; + +ushort* texture_pal_trans[256]; +IDirectDrawPalette* lpDDPalTexture[256]; +ushort* texture_pal_opaque[256]; +ushort default_alpha_pal[256]; + +BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; + +void (*chain)(sWinDispDevCallbackInfo*); + +extern DevDesc g_sD3DDevDesc; + +EXTERN cD6States* pcStates; + +int g_b8888supported; +ulong g_dwRSChangeFlags; +grs_bitmap* default_bm; + +ushort* alpha_pal; +static int callback_id; + +int alpha_size_table[81], generic_size_table[81], rgb_size_table[81], trgb_size_table[81], b8888_size_table[81]; + +sTexBlendArgs sTexBlendArgsProtos[3][2] = +{ + { { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, + { { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, + { { D3DTOP_BLENDDIFFUSEALPHA, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } } +}; + +sTexBlendArgs sMultiTexBlendArgsProtos[3][2] = +{ + { { D3DTOP_SELECTARG1, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, + { { D3DTOP_SELECTARG1, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_CURRENT } }, + { { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG1, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_BLENDTEXTUREALPHA, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_CURRENT } } +}; + +// TODO: initialize in ScrnInit3d +int b_SS2_UseSageTexManager; + +ushort** texture_pal_list[4] = { texture_pal_opaque, texture_pal_opaque, /* is it working? */ &alpha_pal, texture_pal_trans}; + + +void GetAvailableTexMem(ulong* local, ulong* agp); + void calc_size(tdrv_texture_info *info, d3d_cookie cookie); void GetAvailableTexMem(unsigned int *local, unsigned int *agp); void blit_8to16(tdrv_texture_info *info, uint16 *dst, int drow, uint16 *pal); @@ -69,3 +151,894 @@ int init_size_tables(int **p_size_list); void init_size_table(int *size_table, unsigned __int8 type); int munge_size_tables(int **p_size_list); int get_num_sizes(int *size_list, int num_sizes, int *size_table); + + +void CheckSurfaces(sWinDispDevCallbackInfo* info) +{ + int message; + IDirectDrawSurface4* lpTS; + int i; + + message = info->message; + + if (message == kCallbackChainAddFunc) + { + GenericCallbackChainHandler(&callback_id, (void(**)(callback_chain_info*))&chain, &info->chain_info); + } + else if (message == kCallbackChainRemoveFunc) + { + for (i = 0; i < 1024; i++) + { + lpTS = g_saTextures[i].lpSurface; + if (lpTS && lpTS->IsLost() == DDERR_SURFACELOST) + { + if (lpTS->Restore()) + DbgReportWarning("Could not restore lost surface %i!\n", i); + if (g_saTextures[i].pTdrvBitmap) + { + if (!g_tmgr) + CriticalMsg("Hmmm. Should have a non-NULL texture manager here."); + g_tmgr->unload_texture(g_saTextures[i].pTdrvBitmap); + } + } + } + } + + if (chain) + chain(info); +} + +int STDMETHODCALLTYPE EnumTextureFormatsCallback(DDPIXELFORMAT* lpDDPixFmt, void* lpContext) +{ + if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) + { + if (bSpewOn) + mprintf("8 bit palette indexed format\n"); + } + else if ((lpDDPixFmt->dwFlags & DDPF_ALPHA) != 0) + { + if (bSpewOn) + mprintf("Alpha format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount); + } + else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0) + { + if (bSpewOn) + mprintf("RGB format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount); + if (bSpewOn) + mprintf("bitmasks: A %x, R %x G %x B %x\n", lpDDPixFmt->dwRGBAlphaBitMask, lpDDPixFmt->dwRBitMask, lpDDPixFmt->dwGBitMask, lpDDPixFmt->dwBBitMask); + } + else if (bSpewOn) + { + mprintf("other format: %i\n", lpDDPixFmt->dwFlags); + } + + if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 16) + { + if (lpDDPixFmt->dwRGBAlphaBitMask == 0xF000 && lpDDPixFmt->dwRBitMask == 0xF00 && lpDDPixFmt->dwGBitMask == 0xF0 && lpDDPixFmt->dwBBitMask == 0xF) + { + memcpy(&g_AlphaTextureFormat, lpDDPixFmt, sizeof(g_AlphaTextureFormat)); + } + else if (lpDDPixFmt->dwRGBAlphaBitMask == 0x8000 && lpDDPixFmt->dwGBitMask == 0x3E0) + { + memcpy(&g_TransRGBTextureFormat, lpDDPixFmt, sizeof(g_TransRGBTextureFormat)); + } + else if (lpDDPixFmt->dwGBitMask == 0x7E0 || lpDDPixFmt->dwGBitMask == 0x3E0 && !g_RGBTextureFormat.dwFlags) + { + memcpy(&g_RGBTextureFormat, lpDDPixFmt, sizeof(g_RGBTextureFormat)); + } + } + else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 32) + { + if (lpDDPixFmt->dwRGBAlphaBitMask == 0xFF000000 && lpDDPixFmt->dwRBitMask == 0xff0000 && lpDDPixFmt->dwBBitMask == 255) + { + memcpy(&g_8888TexFormat, lpDDPixFmt, sizeof(g_8888TexFormat)); + g_b8888supported = TRUE; + } + } + else if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) + { + memcpy(&g_PalTextureFormat, lpDDPixFmt, sizeof(g_PalTextureFormat)); + } + + return TRUE; +} + +int FindClosestColor(float r, float g, float b) +{ + float dg, dr, db; + float test; + byte* pal; + int i; + int color; + float best; + + best = 196608.0; + pal = grd_pal; + color = -1; + + for (i = 0; i < 256; i++) + { + dr = r - (float)pal[i * 3 + 0]; + dg = g - (float)pal[i * 3 + 1]; + db = b - (float)pal[i * 3 + 2]; + test = dr * dr + db * db + dg * dg; + if (test < (float)best) + { + best = dr * dr + db * db + dg * dg; + color = i; + } + } + if (color < 0) + CriticalMsg("Couldn't fit color."); + return color; +} + +int get_num_sizes(int* size_list, int num_sizes, int* size_table) +{ + int i, j; + + for (i = 0; i < 81; ++i) + { + if (size_table[i] != -1) + { + for (j = 0; j < num_sizes && size_list[j] != size_table[i]; ++j) + ; + if (j == num_sizes) + size_list[num_sizes++] = size_table[i]; + size_table[i] = j; + } + } + return num_sizes; +} + +int munge_size_tables(int** p_size_list) +{ + int* size_list; + int num_sizes; + + size_list = (int*)malloc(1620); + num_sizes = get_num_sizes(size_list, + get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, 0, alpha_size_table), + generic_size_table), rgb_size_table), trgb_size_table), b8888_size_table); + *p_size_list = (int*)Realloc(size_list, 4 * num_sizes); + return num_sizes; +} + +void init_size_table(int* size_table, byte type) +{ + int i, j; + tdrv_texture_info info; + int w, h; + d3d_cookie cookie; + + info.id = 0; + cookie.flags = type; + + for (i = 0, w = 1; i < 81; i += 9, w *= 2) + { + for (j = 0, h = 1; j < 9; j++, h *= 2) + { + info.bm = gr_alloc_bitmap((type != 0 && type != TF_RGB) ? (type == TF_TRANS ? BMT_FLAT32 : BMT_FLAT16) : BMT_FLAT8, 0, w, h); + info.scale_h = 0; + info.scale_w = 0; + info.w = info.bm->w; + info.h = info.bm->h; + info.size_index = -1; + info.bits = info.bm->bits; + cookie.wlog = info.bm->wlog; + cookie.hlog = info.bm->hlog; + info.cookie = cookie.value; + + if (pcStates->load_texture(&info) == -1) + { + size_table[j + i] = -1; + } + else + { + if (b_SS2_UseSageTexManager) + size_table[j + i] = type + 5 * (j + i); + else + size_table[j + i] = info.size_index; + pcStates->release_texture(info.id); + } + + gr_free(info.bm); + } + } +} + +int init_size_tables(int** p_size_list) +{ + init_size_table(alpha_size_table, TF_RGB); + init_size_table(generic_size_table, 0); + init_size_table(rgb_size_table, TF_ALPHA); + init_size_table(trgb_size_table, TF_ALPHA | TF_RGB); + init_size_table(b8888_size_table, TF_TRANS); + munge_size_tables(p_size_list); +} + +void InitDefaultTexture(int size) +{ + grs_bitmap* bm; + int i, j; + byte c0, c1; + + bm = gr_alloc_bitmap(2, 0, size, size); + + c0 = FindClosestColor(180, 10, 10); + c1 = FindClosestColor(10, 180, 10); + + for (i = 0; i < size; ++i) + { + for (j = 0; j < size; ++j) + { + bm->bits[j + i * size] = ((i + j) & 1) != 0 ? c0 : c1; + } + } + + default_bm = bm; +} + +cD6States::cD6States() +{ + m_bTextureListInitialized = 0; + m_bTexture_RGB = 0; + m_bUsingLocalMem = 0; + m_bLocalMem_available = 0; + m_bAGP_available = 0; + m_bWBuffer = 0; + m_bSpecular = 0; +} + +int cD6States::Initialize(ulong dwRequestedFlags) +{ + int i; + IWinDisplayDevice* pWinDisplayDevice; + + m_texture_caps = g_sD3DDevDesc.dpcTriCaps.dwTextureCaps; + m_bWBuffer = (dwRequestedFlags & LGD3DF_WBUFFER) != 0; + + EnumerateTextureFormats(); + + for (i = 0; i < 256; ++i) + { + texture_pal_opaque[i] = 0; + texture_pal_trans[i] = 0; + lpDDPalTexture[i] = 0; + } + + pcStates->SetPalSlotFlags(0, 256, grd_pal, 0, 3); + + alpha_pal = default_alpha_pal; + + pcStates->SetChromaKey(m_psCurrentRS->chroma_r, m_psCurrentRS->chroma_g, m_psCurrentRS->chroma_b); + + memset(g_saTextures, 0, sizeof(g_saTextures)); + m_bTextureListInitialized = TRUE; + + pWinDisplayDevice = AppGetObj(IWinDisplayDevice); + pWinDisplayDevice->AddTaskSwitchCallback(CheckSurfaces); + if (pWinDisplayDevice) + pWinDisplayDevice->Release(); + + InitDefaultTexture(16); + + InitTextureManager(); + SetDefaultsStates(dwRequestedFlags); +} + +#define NONLOCAL_CAPS DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM | DDSCAPS_ALLOCONLOAD +#define LOCAL_CAPS DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ALLOCONLOAD + +void cD6States::EnumerateTextureFormats() +{ + HRESULT hr; + DevDesc hal; + DevDesc hel; + IDirectDrawSurface4* test_surf; + DDSURFACEDESC2 ddsd; + + memset(&g_RGBTextureFormat, 0, sizeof(g_RGBTextureFormat)); + memset(&g_TransRGBTextureFormat, 0, sizeof(g_TransRGBTextureFormat)); + memset(&g_PalTextureFormat, 0, sizeof(g_PalTextureFormat)); + memset(&g_8888TexFormat, 0, sizeof(g_8888TexFormat)); + g_b8888supported = 0; + + if (hr = g_lpD3Ddevice->EnumTextureFormats((LPD3DENUMPIXELFORMATSCALLBACK)EnumTextureFormatsCallback, 0), hr != S_OK) + { + CriticalMsg3(pcDXef, "EnumTextureFormats failed", (ushort)hr, GetDDErrorMsg(hr)); + } + + m_bTexture_RGB = g_bPrefer_RGB; + + g_FormatList[0] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; + + if (!g_FormatList[0]->dwFlags) + { + m_bTexture_RGB = m_bTexture_RGB == FALSE; + g_FormatList[0] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; + if (!g_FormatList[0]->dwFlags) + CriticalMsg("Direct3D device does not support 8 bit palettized or 15 or 16 bit RGB textures"); + } + + g_FormatList[1] = &g_RGBTextureFormat; + g_FormatList[2] = &g_AlphaTextureFormat; + g_FormatList[3] = &g_TransRGBTextureFormat; + g_FormatList[4] = &g_8888TexFormat; + + if (bSpewOn) + mprintf("Using %s textures\n", m_bTexture_RGB ? "16 bit RGB" : "Palettized"); + + if (!g_AlphaTextureFormat.dwFlags && bSpewOn) + mprintf("no alpha texture format available.\n"); + + memset(&hal, 0, sizeof(hal)); + hal.dwSize = sizeof(hal); + memset(&hel, 0, sizeof(hel)); + hel.dwSize = sizeof(hel); + + if (hr = g_lpD3Ddevice->GetCaps(&hal, &hel), hr != S_OK) + { + CriticalMsg3(pcDXef, "Failed to obtain device caps", (ushort)hr, GetDDErrorMsg(hr)); + } + + if ((hal.dwFlags & 2) == 0) + CriticalMsg("No HAL device!"); + + memset(&ddsd, 0, sizeof(ddsd)); + memcpy(&ddsd.ddpfPixelFormat, g_FormatList[0], sizeof(ddsd.ddpfPixelFormat)); + ddsd.dwHeight = 256; + ddsd.dwWidth = 256; + + m_bAGP_available = 0; + m_bLocalMem_available = 0; + + if ((hal.dwDevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM) != 0) + { + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.ddsCaps.dwCaps = NONLOCAL_CAPS; + if (g_lpDD_ext->CreateSurface(&ddsd, &test_surf, 0) == S_OK) + { + if (test_surf) + { + test_surf->Release(); + test_surf = 0; + m_bAGP_available = TRUE; + m_DeviceSurfaceCaps = NONLOCAL_CAPS; + if (bSpewOn) + mprintf("nonlocal videomemory textures available.\n"); + } + } + } + + if ((hal.dwDevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) != 0) + { + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.ddsCaps.dwCaps = LOCAL_CAPS; + if (g_lpDD_ext->CreateSurface(&ddsd, &test_surf, 0) == S_OK) + { + if (test_surf) + { + test_surf->Release(); + test_surf = 0; + m_bLocalMem_available = TRUE; + m_DeviceSurfaceCaps = LOCAL_CAPS; + if (bSpewOn) + mprintf("local videomemory textures available.\n"); + } + } + } + + if (!m_bAGP_available && !m_bLocalMem_available) + { + if (bSpewOn) + mprintf("No local or nonlocal texture memory! Using system memory textures.\n"); + m_DeviceSurfaceCaps = DDSCAPS_ALLOCONLOAD | DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + } + + m_bUsingLocalMem = m_bLocalMem_available; +} + +void cD6States::InitTextureManager() +{ + if (g_tmgr) + { + g_tmgr->shutdown(); + g_tmgr = 0; + } + + g_tmgr = get_dopey_texture_manager(pcStates); + g_tmgr->init(default_bm, LGD3D_MAX_TEXTURES, m_texture_size_list, init_size_tables(&m_texture_size_list), TMGRF_SPEW); +} + +ulong cD6States::GetRenderStatesSize() +{ + return sizeof(sRenderStates); +} + +void cD6States::SetPointerToCurrentStates(char* p) +{ + this->m_psCurrentRS = (sRenderStates*)p; +} + +void cD6States::SetPointerToSetStates(char* p) +{ + this->m_psSetRS = (sRenderStates*)p; +} + +void cD6States::SetCommonDefaultStates(ulong dwRequestedFlags, int bMultiTexture) +{ + HRESULT hRes, hResult, hR; + ulong dwPasses; + + memset(m_psCurrentRS, 0, sizeof(sRenderStates)); + + m_bCanDither = (dwRequestedFlags & LGD3DF_CAN_DO_DITHER) != 0; + m_psCurrentRS->bDitheringOn = m_bCanDither != 0 && (dwRequestedFlags & LGD3DF_DITHER) != 0; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DITHERENABLE, m_psCurrentRS->bDitheringOn); + + m_bCanAntialias = (dwRequestedFlags & LGD3DF_CAN_DO_ANTIALIAS) != 0; + m_psCurrentRS->bAntialiasingOn = m_bCanAntialias != 0 && (dwRequestedFlags & LGD3DF_ANTIALIAS) != 0; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ANTIALIAS, m_psCurrentRS->bAntialiasingOn != 0 ? D3DANTIALIAS_SORTINDEPENDENT : D3DANTIALIAS_NONE); + + m_psCurrentRS->bUsePalette = TRUE; + m_psCurrentRS->nAlphaColor = 255; + + // cD6Primitives + pcRenderBuffer->PassAlphaColor(m_psCurrentRS->nAlphaColor); + + m_psCurrentRS->eShadeMode = D3DSHADE_GOURAUD; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SHADEMODE, m_psCurrentRS->eShadeMode); + + if (g_bUseDepthBuffer) + { + // choose between z- and w- buffering + m_psCurrentRS->eZenable = D3DZBUFFERTYPE((m_bWBuffer != FALSE) + 1); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZENABLE, m_psCurrentRS->eZenable); + + m_psCurrentRS->bZWriteEnable = FALSE; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZWRITEENABLE, m_psCurrentRS->bZWriteEnable); + + m_psCurrentRS->eZCompareFunc = D3DCMP_ALWAYS; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZFUNC, m_psCurrentRS->eZCompareFunc); + } + + m_psCurrentRS->bFogOn = 0; + m_psCurrentRS->dwFogColor = 0; + m_psCurrentRS->eFogMode = D3DFOG_EXP; + m_psCurrentRS->fFogTableDensity = 0.025f; + m_psCurrentRS->dcFogSpecular = 0xFF000000; + + // primitives + pcRenderBuffer->PassFogSpecularColor(m_psCurrentRS->dcFogSpecular); + + if (g_bUseTableFog) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGENABLE, m_psCurrentRS->bFogOn); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLEMODE, m_psCurrentRS->eFogMode); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGCOLOR, m_psCurrentRS->dwFogColor); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLEDENSITY, m_psCurrentRS->fFogTableDensity); + } + else if (g_bUseVertexFog) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGENABLE, m_psCurrentRS->bFogOn); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGCOLOR, m_psCurrentRS->dwFogColor); + } + + m_psCurrentRS->naTextureId[0] = -1; + m_psCurrentRS->naTextureId[1] = -1; + if (hR = g_lpD3Ddevice->SetTexture(0, NULL), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + + m_psCurrentRS->bPerspectiveCorr = 1; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_TEXTUREPERSPECTIVE, m_psCurrentRS->bPerspectiveCorr); + + m_psCurrentRS->baChromaKeying[0] = 0; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_COLORKEYENABLE, m_psCurrentRS->baChromaKeying[0]); + + + m_psCurrentRS->eWrap[0] = D3DTADDRESS_WRAP; + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_ADDRESS, m_psCurrentRS->eWrap[0]); + + m_psCurrentRS->eMagTexFilter = D3DTFN_LINEAR; + m_psCurrentRS->eMinTexFilter = D3DTFN_LINEAR; + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MAGFILTER, m_psCurrentRS->eMagTexFilter); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MINFILTER, m_psCurrentRS->eMinTexFilter); + + m_psCurrentRS->dwTexBlendMode[1] = 0; + m_psCurrentRS->baTextureWithAlpha[0] = 0; + m_psCurrentRS->baTextureWithAlpha[1] = 0; + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SPECULARENABLE, m_bSpecular); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_STENCILENABLE, 0); + + m_psSetRS->dwNoLightMapLevels = 2; + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[0], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + + if (bMultiTexture) + { + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + } + + m_bCanModulate = g_lpD3Ddevice->ValidateDevice(&dwPasses) == S_OK; + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[1], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + + if (bMultiTexture) + { + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + } + + hR = g_lpD3Ddevice->ValidateDevice(&dwPasses); + m_bCanModulateAlpha = hR == S_OK; + + if (m_bCanModulate || m_bCanModulateAlpha) + { + m_psCurrentRS->dwTexBlendMode[0] = (dwRequestedFlags & LGD3DF_MODULATEALPHA) != 0 ? m_bCanModulateAlpha != FALSE : m_bCanModulate == FALSE; + } + else + { + SetLGD3DErrorCode(LGD3D_EC_VD_MPASS_MT, hR); + if (bSpewOn) + { + CriticalMsg4(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + } + else + { + DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + } + lgd3d_g_bInitialized = 0; + } +} + +int cD6States::SetDefaultsStates(ulong dwRequestedFlags) +{ + HRESULT hRes, hResult, hR; + ulong dwPasses; + + SetCommonDefaultStates(dwRequestedFlags, FALSE); + + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[m_psCurrentRS->dwTexBlendMode[0]], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + + if ((dwRequestedFlags & LGD3DF_MULTITEXTURE_COLOR) != 0) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SRCBLEND, D3DBLEND_DESTCOLOR); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO); + + if (hR = g_lpD3Ddevice->ValidateDevice(&dwPasses), hR != S_OK) + { + SetLGD3DErrorCode(LGD3D_EC_VD_MPASS_MT, hR); + if (bSpewOn) + { + CriticalMsg4(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + } + else + { + DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + } + lgd3d_g_bInitialized = 0; + + return FALSE; + } + } + + m_psCurrentRS->eSrcAlpha = D3DBLEND_SRCALPHA; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SRCBLEND, m_psCurrentRS->eSrcAlpha); + m_psCurrentRS->eDstAlpha = D3DBLEND_INVSRCALPHA; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DESTBLEND, m_psCurrentRS->eDstAlpha); + + if (hR = g_lpD3Ddevice->ValidateDevice(&dwPasses), hR != S_OK) + { + SetLGD3DErrorCode(LGD3D_EC_VD_S_DEFAULT, hR); + if (bSpewOn) + { + CriticalMsg4(pcLGD3Def, LGD3D_EC_VD_S_DEFAULT, GetLgd3dErrorCode(LGD3D_EC_VD_S_DEFAULT), (ushort)hR, GetDDErrorMsg(hR)); + } + else + { + DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_S_DEFAULT, GetLgd3dErrorCode(LGD3D_EC_VD_S_DEFAULT), (ushort)hR, GetDDErrorMsg(hR)); + } + lgd3d_g_bInitialized = 0; + + return FALSE; + } + + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[m_psCurrentRS->dwTexBlendMode[0]], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + + m_psCurrentRS->bAlphaOn = FALSE; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + + memcpy(m_psSetRS, m_psCurrentRS, sizeof(sRenderStates)); + + g_dwRSChangeFlags = 0; + + return TRUE; +} + +void cD6States::synchronize() +{ + pcRenderBuffer->FlushPrimitives(); +} + +void cD6States::start_frame(int n) +{ + pcRenderer->StartFrame(n); +} + +void cD6States::end_frame() +{ + pcRenderer->EndFrame(); +} + +int cD6States::load_texture(tdrv_texture_info* info) +{ + ulong local_end, agp_end; + ulong local_start, agp_start; + int size; + int status; + + local_start = 0; + agp_start = 0; + size = info->size_index < 0 ? 0 : m_texture_size_list[info->size_index]; + + if ((m_texture_caps & 0x20) != 0 && info->w != info->h) + return TMGR_FAILURE; + + if (!b_SS2_UseSageTexManager) + { + GetAvailableTexMem(m_bLocalMem_available != 0 ? &local_start : 0, m_bAGP_available != 0 ? &agp_start : 0); + + if (local_start < size && m_bUsingLocalMem && m_bAGP_available) + { + if (bSpewOn) + mprintf("using nonlocal vidmem textures...\n"); + + m_bUsingLocalMem = 0; + m_DeviceSurfaceCaps = NONLOCAL_CAPS; + } + + if ((m_bUsingLocalMem ? local_start : agp_start) < size) + return TMGR_FAILURE; + } + + if (info->id >= LGD3D_MAX_TEXTURES) + CriticalMsg("Texture id out of range"); + + status = reload_texture(info); + + if (status && m_bUsingLocalMem && m_bAGP_available) + { + if (bSpewOn) + mprintf("using nonlocal vidmem textures...\n"); + + m_bUsingLocalMem = 0; + m_DeviceSurfaceCaps = NONLOCAL_CAPS; + + status = reload_texture(info); + } + + if (status != TMGR_SUCCESS) + return status; + + if (b_SS2_UseSageTexManager || size) + return TMGR_SUCCESS; + + GetAvailableTexMem(m_bLocalMem_available != 0 ? &local_end : 0, m_bAGP_available != 0 ? &agp_end : 0); + + if (m_bLocalMem_available && local_start > local_end) + { + info->size_index = local_start - local_end; + + if (m_bAGP_available) + info->size_index += agp_start - agp_end; + + return TMGR_SUCCESS; + } + + if (m_bAGP_available && agp_start != agp_end) + { + info->size_index = agp_start - agp_end; + + return TMGR_SUCCESS; + } + + DbgReportWarning("Texture load took no space!\n"); + + if (info->w == 1 && info->h == 1) + { + info->size_index = 16; + + return TMGR_SUCCESS; + } + else + { + DbgReportError(1, "Direct3d device driver does not accurately report texture memory usage.\n Contact your 3d accelerator vendor for updated drivers."); + return TMGR_FAILURE; + } +} + +void cD6States::release_texture(int n) +{ + DDSCAPS2 ddscaps; + sTextureData* psTexData; + + if (n >= LGD3D_MAX_TEXTURES) + CriticalMsg("Texture id out of range"); + + psTexData = &g_saTextures[n]; + + if (n == m_psCurrentRS->naTextureId[0]) + pcRenderBuffer->FlushPrimitives(); + + if (!psTexData->lpSurface) + DbgReportWarning("texture %i already released\n", n); + + if (psTexData->lpSurface && m_bLocalMem_available && !m_bUsingLocalMem) + { + psTexData->lpSurface->GetCaps(&ddscaps); + + if ((ddscaps.dwCaps & DDSCAPS_LOCALVIDMEM) != 0) + { + if (bSpewOn) + mprintf("Using Local vidmem textures\n"); + + m_DeviceSurfaceCaps = LOCAL_CAPS; + m_bUsingLocalMem = TRUE; + } + } + + RELEASE(psTexData->lpTexture); + RELEASE(psTexData->lpSurface); + + psTexData->pTdrvBitmap = 0; +} + +int cD6States::reload_texture(tdrv_texture_info* info) +{ + IDirectDrawSurface4* SysmemSurface, **pDeviceSurface; + DDSURFACEDESC2 pddsd; + d3d_cookie cookie; + LPDDPIXELFORMAT pixel_format; + HRESULT LastError; + IDirect3DTexture2 *SysmemTexture = NULL, **pDeviceTexture; + + pDeviceTexture = &g_saTextures[info->id].lpTexture; + pDeviceSurface = &g_saTextures[info->id].lpSurface; + cookie.value = info->cookie; + + pixel_format = g_FormatList[cookie.flags & (TF_TRANS | TF_ALPHA | TF_RGB)]; + if ((cookie.flags & (TF_TRANS | TF_ALPHA | TF_RGB)) == TF_TRANS && !g_b8888supported) + pixel_format = g_FormatList[2]; + + if (pixel_format->dwFlags == 0) + return TDRV_FAILURE; + + memset(&pddsd, 0, sizeof(pddsd)); + pddsd.dwSize = sizeof(pddsd); + pddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + pddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + pddsd.dwHeight = info->h; + pddsd.dwWidth = info->w; + memcpy(&pddsd.ddpfPixelFormat, pixel_format, sizeof(pddsd.ddpfPixelFormat)); + + LastError = CreateDDSurface(cookie, &pddsd, &SysmemSurface); + CheckHResult(LastError, "CreateSurface() failed"); + AssertMsg(SysmemSurface != NULL, "NULL SysmemSurface"); + + LastError = SysmemSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)&SysmemTexture); + CheckHResult(LastError, "Failed to obtain D3D texture interface for sysmem surface"); + + pddsd.dwSize = sizeof(DDSURFACEDESC2); + pddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + + if (*pDeviceTexture == NULL) { + IDirectDrawSurface4* DeviceSurface; + + pddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &pddsd, pDeviceSurface); + if ((LastError != DD_OK) && m_bUsingLocalMem && m_bAGP_available) + { + mono_printf(("using nonlocal vidmem textures...\n")); + // try AGP textures... + m_bUsingLocalMem = FALSE; + m_DeviceSurfaceCaps = NONLOCAL_CAPS; + pddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &pddsd, pDeviceSurface); + } + + if (LastError != DD_OK) { + mono_printf(("couldn't load texture: error %i.\n", LastError & 0xffff)); + SafeRelease(SysmemTexture); + SafeRelease(SysmemSurface); + *pDeviceSurface = NULL; + return TDRV_FAILURE; + } + + DeviceSurface = *pDeviceSurface; + +#define MEMORY_TYPE_MASK \ + (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM|DDSCAPS_NONLOCALVIDMEM) + + if ((m_DeviceSurfaceCaps & MEMORY_TYPE_MASK) != (pddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)) + mono_printf(( + "device texture not created in requested memory location\nRequested %x Received %x\n", + m_DeviceSurfaceCaps & MEMORY_TYPE_MASK, pddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)); + + + // Query our device surface for a texture interface + LastError = DeviceSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)pDeviceTexture); + CheckHResult(LastError, "Failed to obtain D3D texture interface for device surface."); + } + + // Load the bitmap into the sysmem surface + LastError = SysmemSurface->Lock(NULL, &pddsd, 0, NULL); + CheckHResult(LastError, "Failed to lock sysmem surface."); + + LoadSurface(info, &pddsd); + + LastError = SysmemSurface->Unlock(NULL); + CheckHResult(LastError, "Failed to unlock sysmem surface."); + + // Load the sysmem texture into the device texture. During this call, a + // driver could compress or reformat the texture surface and put it in + // video memory. + + LastError = pDeviceTexture[0]->Load(SysmemTexture); + CheckHResult(LastError, "Failed to load device texture from sysmem texture."); + + // Now we are done with sysmem surface + + SafeRelease(SysmemTexture); + SafeRelease(SysmemSurface); + + g_saTextures[info->id].pTdrvBitmap = info->bm; + g_saTextures[info->id].TdrvCookie.value = info->cookie; + + return TDRV_SUCCESS; +} + + + +void GetAvailableTexMem(ulong* local, ulong* agp) +{ + DDSCAPS2 ddscaps; + ulong total; + + if (!g_lpDD_ext) + CriticalMsg("No DirectDraw object!"); + + memset(&ddscaps, 0, sizeof(ddscaps)); + + if (local) + { + ddscaps.dwCaps = NONLOCAL_CAPS; + g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, local); + } + + if (agp) + { + ddscaps.dwCaps = NONLOCAL_CAPS; + g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, agp); + } +} + From 4c236aed7d6d833dc73c8019043d2c8e90900850 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 01:41:58 +0300 Subject: [PATCH 03/35] update from local, d6Enum.cpp --- libsrc/lgd3d/d6Enum.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp index 4c4c3f1..1700c82 100644 --- a/libsrc/lgd3d/d6Enum.cpp +++ b/libsrc/lgd3d/d6Enum.cpp @@ -1,6 +1,10 @@ #include #include #include +#include + +IDirect3DDevice3* g_lpD3Ddevice; +int bSpewOn; int lgd3d_enumerate_devices(); int lgd3d_enumerate_devices_capable_of(unsigned long flags); @@ -10,4 +14,4 @@ lgd3ds_device_info *lgd3d_get_device_info(int device_number); int c_DDEnumCallback(GUID *lpGUID, const char *lpDriverDescription, const char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); void GetDevices(LGD3D_sEnumerationInfo *info); int c_EnumDisplayModesCallback(DDSURFACEDESC2 *pSD, char *data); -int c_EnumDevicesCallback(GUID *lpGuid, const char *lpDeviceDescription, const char *lpDeviceName, D3DDEVICEDESC *pDeviceDesc, D3DDEVICEDESC *lpD3DHELDeviceDesc, void *lpUserArg); \ No newline at end of file +int c_EnumDevicesCallback(GUID *lpGuid, const char *lpDeviceDescription, const char *lpDeviceName, D3DDEVICEDESC *pDeviceDesc, D3DDEVICEDESC *lpD3DHELDeviceDesc, void *lpUserArg); From b8b4eaadf2b3818b5b30d624077d5e6bf6349438 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 01:42:42 +0300 Subject: [PATCH 04/35] update from local, d6Frame.cpp --- libsrc/lgd3d/d6Frame.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp index 1fd0975..8d33f20 100644 --- a/libsrc/lgd3d/d6Frame.cpp +++ b/libsrc/lgd3d/d6Frame.cpp @@ -1,6 +1,10 @@ #include #include #include +#include + +DevDesc g_sD3DDevDesc; +IDirectDraw4* g_lpDD_ext; class cD6Frame { public: From f18022299c47269c5e23c49f48fe0bfb68005f50 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 01:55:25 +0300 Subject: [PATCH 05/35] update from local, d6States.h --- libsrc/lgd3d/d6States.h | 119 +++++++++++++++++++++++++++------------- 1 file changed, 82 insertions(+), 37 deletions(-) diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index 7ba7577..aff7ef3 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -1,19 +1,26 @@ #pragma once +#include +#include + #include +#include #include #include #include -struct d3d_cookie { - uint8 wlog; - uint8 hlog; - uint8 flags; - uint8 palette; - unsigned long value; -}; +typedef struct d3d_cookie { + union { + struct { + uchar wlog, hlog; + uchar flags; + uchar palette; + }; + ulong value; + }; +} d3d_cookie; struct tdrv_texture_info { @@ -75,36 +82,46 @@ struct sRenderStates D3DTEXTUREMINFILTER eMinTexFilter; }; +typedef struct +{ + IDirect3DTexture2* lpTexture; + IDirectDrawSurface4* lpSurface; + grs_bitmap* pTdrvBitmap; + d3d_cookie TdrvCookie; +} sTextureData; + class cD6States { public: virtual int Initialize(DWORD dwRequestedFlags); -private: +protected: unsigned long m_DeviceSurfaceCaps; int *m_texture_size_list; unsigned long m_texture_caps; - bool m_bTextureListInitialized; + BOOL m_bTextureListInitialized; sRenderStates *m_psCurrentRS; sRenderStates *m_psSetRS; - bool m_bTexture_RGB; - bool m_bUsingLocalMem; - bool m_bLocalMem_available; - bool m_bAGP_available; - bool m_bWBuffer; - bool m_bCanDither; - bool m_bCanAntialias; - bool m_bSpecular; - bool m_bCanModulate; - bool m_bCanModulateAlpha; +private: + BOOL m_bTexture_RGB; + BOOL m_bUsingLocalMem; + BOOL m_bLocalMem_available; + BOOL m_bAGP_available; + BOOL m_bWBuffer; + BOOL m_bCanDither; + BOOL m_bCanAntialias; + BOOL m_bSpecular; + BOOL m_bCanModulate; + BOOL m_bCanModulateAlpha; protected: void EnumerateTextureFormats(); void InitTextureManager(); virtual int SetDefaultsStates(DWORD dwRequestedFlags); - void SetCommonDefaultStates(DWORD dwRequestedFlags, bool bMultiTexture); + void SetCommonDefaultStates(DWORD dwRequestedFlags, BOOL bMultiTexture); - cD6States(const cD6States &); + // copy ctr was created by compiler + // cD6States(const cD6States &); cD6States(); virtual ~cD6States(); @@ -131,40 +148,40 @@ class cD6States long CreateDDSurface(d3d_cookie cookie, DDSURFACEDESC2 *pddsd, IDirectDrawSurface4 **ppDDS); void LoadSurface(tdrv_texture_info *info, DDSURFACEDESC2 *pddsd); int get_texture_id(); - virtual void TurnOffTexuring(bool bTexOff); + virtual void TurnOffTexuring(BOOL bTexOff); void SetTextureNow(); - virtual cD6States *DeInstance(); - void SetDithering(bool bOn); + virtual cD6States *DeInstance() = 0; // abstract for cD6States + void SetDithering(BOOL bOn); int GetDitheringState(); - void SetAntialiasing(bool bOn); + void SetAntialiasing(BOOL bOn); int GetAntialiasingState(); virtual void EnableDepthBuffer(int nFlag); int GetDepthBufferState(); - virtual void SetZWrite(bool bZWriteOn); + virtual void SetZWrite(BOOL bZWriteOn); bool IsZWriteOn(); - virtual void SetZCompare(bool bZCompreOn); + virtual void SetZCompare(BOOL bZCompreOn); bool IsZCompareOn(); virtual void SetFogDensity(float fDensity); - int UseLinearTableFog(bool bOn); + int UseLinearTableFog(BOOL bOn); void SetFogStartAndEnd(float fStart, float fEnd); void SetLinearFogDistance(float fDistance); void SetAlphaColor(float fAlpha); - void EnableAlphaBlending(bool bAlphaOn); - bool IsAlphaBlendingOn(); + void EnableAlphaBlending(BOOL bAlphaOn); + BOOL IsAlphaBlendingOn(); void SetAlphaModulateHack(int iBlendMode); void ResetDefaultAlphaModulate(); void SetTextureMapMode(DWORD dwFlag); void GetTexBlendingModes(DWORD *pdw0LevelMode, DWORD *pdw1LevelMode); - int SetSmoothShading(bool bSmoothOn); - bool IsSmoothShadingOn(); - void EnableFog(bool bFogOn); - bool IsFogOn(); + int SetSmoothShading(BOOL bSmoothOn); + BOOL IsSmoothShadingOn(); + void EnableFog(BOOL bFogOn); + BOOL IsFogOn(); void SetFogSpecularLevel(float fLevel); void SetFogColor(int r, int g, int b); unsigned long get_color(); void SetTexturePalette(int start, int n, uint8 *pal, int slot); - void EnablePalette(bool bPalOn); - bool IsPaletteOn(); + void EnablePalette(BOOL bPalOn); + BOOL IsPaletteOn(); void SetPalSlotFlags(int start, int n, uint8 *pal_data, int slot, char flags); void SetAlphaPalette(uint16 *pal); virtual void SetChromaKey(int r, int g, int b); @@ -174,4 +191,32 @@ class cD6States private: float LinearWorldIntoFogCoef(float fLin); -}; \ No newline at end of file +public: + // cD6States& operator=(const cD6States&); +}; + + +#define SetRenderStateForGlobal(dev, key, value) \ + if (hRes = dev->SetRenderState(key, value), hRes != S_OK) \ + { \ + CriticalMsg3(pcDXef, "SetRenderStateForGlobal failed", (ushort)hRes, GetDDErrorMsg(hRes)); \ + } + +#define SetTextureStageStateForGlobal(dev, stage, key, value) \ + if (hResult = dev->SetTextureStageState(stage, key, value), hResult != S_OK) \ + { \ + CriticalMsg3(pcDXef, "SetTextureStageState failed", (ushort)hResult, GetDDErrorMsg(hResult)); \ + } + +#define SetTextureStageColors(dev, stage, rs) \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_COLOROP, rs->saTexBlend[stage].eColorOperation); \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_COLORARG1, rs->saTexBlend[stage].dwColorArg1); \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_COLORARG2, rs->saTexBlend[stage].dwColorArg2); \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_ALPHAOP, rs->saTexBlend[stage].eAlphaOperation); \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_ALPHAARG1, rs->saTexBlend[stage].dwAlphaArg1); \ + SetTextureStageStateForGlobal(dev, stage, D3DTSS_ALPHAARG2, rs->saTexBlend[stage].dwAlphaArg2); + +extern cD6States* pcStates; +extern IDirect3DDevice3* g_lpD3Ddevice; +extern IDirectDraw4* g_lpDD_ext; +extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; From 01f714f09a6497d8243a76e32bace0d043e2c35d Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:03:31 +0300 Subject: [PATCH 06/35] update from local, d6Base.cpp --- libsrc/lgd3d/d6Base.cpp | 77 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index ec13d90..7033a6f 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -1,7 +1,76 @@ +#include "lgd3d.h" +#include + +#include "d6States.h" + #include -static int lgd3d_get_error(DWORD *pdwCode, unsigned long *phResult); +static BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult) +{ + if (!dwErrorCode) + return FALSE; + + *pdwCode = dwErrorCode; + *phResult = hD3DError; + + return TRUE; +} + +void SetLGD3DErrorCode(DWORD dwCode, long hRes) +{ + dwErrorCode = dwCode; + hD3DError = hRes; +} + +// делаешь совместимость с компилятором от 22 студии? к чему тогда такая точность реверса?? +const char *GetLgd3dErrorCode(DWORD dwErrorCode) +{ + switch (dwErrorCode) + { + case LGD3D_EC_DD_KAPUT: + return (char*)"Could not obtain DirectDraw from display"; + case LGD3D_EC_RESTORE_ALL_SURFS: + return (char*)"Could not restore all surfaces"; + case LGD3D_EC_QUERY_D3D: + return (char*)"QueryInterface for D3D failed"; + case LGD3D_EC_GET_DD_CAPS: + return (char*)" GetCaps for DirectDraw failed"; + case LGD3D_EC_ZBUFF_ENUMERATION: + return (char*)" Could not enumerate Zbuffer formats"; + case LGD3D_EC_CREATE_3D_DEVICE: + return (char*)"Create D3D device failed"; + case LGD3D_EC_CREATE_VIEWPORT: + return (char*)"Creation of thr viewport failed"; + case LGD3D_EC_ADD_VIEWPORT: + return (char*)" Addition of the viewport failed"; + case LGD3D_EC_SET_VIEWPORT: + return (char*)"Setting of the viewport2 failed"; + case LGD3D_EC_SET_CURR_VP: + return (char*)"Setting of current viewport failed"; + case LGD3D_EC_CREATE_BK_MATERIAL: + return (char*)"Creation of the background material failed"; + case LGD3D_EC_SET_BK_MATERIAL: + return (char*)"Setting of the background material failed"; + case LGD3D_EC_GET_BK_MAT_HANDLE: + return (char*)"Could not obtain a material handle"; + case LGD3D_EC_GET_SURF_DESC: + return (char*)"Could not get surface description"; + case LGD3D_EC_GET_3D_CAPS: + return (char*)"Could not get D3D device caps"; + case LGD3D_EC_VD_MPASS_MT: + return (char*)"ValidateDevice for multipass lightmaps failed"; + case LGD3D_EC_VD_S_DEFAULT: + return (char*)"ValidateDevice for simple states failed"; + case LGD3D_EC_VD_SPASS_MT: + return (char*)"ValidateDevice for single pass lightmaps failed"; + case LGD3D_EC_VD_M_DEFAULT: + return (char*)"ValidateDevice for multitexture states failed"; + default: + return (char*)"Unknown error"; + } +} -void SetLGD3DErrorCode(DWORD dwCode, long hRes); -const char *GetLgd3dErrorCode(DWORD dwErrorCode); -const char *GetDDErrorMsg(long hRes); +const char *GetDDErrorMsg(long hRes) +{ + // dx7 error list +} From c7d3f5cd86fa1b2574a8ab092982336afafd0e1c Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:07:04 +0300 Subject: [PATCH 07/35] removed lgd3d.h --- libsrc/lgd3d/d6Base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index 7033a6f..1c86dbc 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -1,4 +1,4 @@ -#include "lgd3d.h" + #include #include "d6States.h" From 80c7449796d08df5ead3a0ac46eca38f77a0a213 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:07:24 +0300 Subject: [PATCH 08/35] removed lgd3d.h --- libsrc/lgd3d/d6Frame.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp index 8d33f20..8667db1 100644 --- a/libsrc/lgd3d/d6Frame.cpp +++ b/libsrc/lgd3d/d6Frame.cpp @@ -1,5 +1,4 @@ #include -#include #include #include From b44ec70859403fd1a8b1aa08ce4968cbac57161a Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:07:54 +0300 Subject: [PATCH 09/35] removed lgd3d.h --- libsrc/lgd3d/d6Prim.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h index eea341f..3662784 100644 --- a/libsrc/lgd3d/d6Prim.h +++ b/libsrc/lgd3d/d6Prim.h @@ -5,7 +5,6 @@ #include #include #include -#include class cD6Primitives { protected: @@ -124,4 +123,4 @@ class cD6Primitives { void do_quad_light(r3s_point *p, float r, grs_bitmap *bm); void HackLight(r3s_point *p, float r); void HackLightExtra(r3s_point *p, float r, grs_bitmap *bm); -}; \ No newline at end of file +}; From 0033d7cc9f880a700249d8d2b8ff0506c1c66d19 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:08:19 +0300 Subject: [PATCH 10/35] removed lgd3d.h --- libsrc/lgd3d/d6States.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index aff7ef3..49cb207 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include From 58f7407b816b712782b709ae9d833a309019c47c Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:08:39 +0300 Subject: [PATCH 11/35] removed lgd3d.h --- libsrc/lgd3d/d6sts_s.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 128d18d..af8186c 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -1,4 +1,4 @@ -#include + #include #include #include From 6e5a994e9511312f9ddc8eefbd6866322ca7424c Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 21 Jun 2024 02:13:10 +0300 Subject: [PATCH 12/35] Update d6States.h --- libsrc/lgd3d/d6States.h | 116 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index 49cb207..9cb77b0 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -219,3 +219,119 @@ extern cD6States* pcStates; extern IDirect3DDevice3* g_lpD3Ddevice; extern IDirectDraw4* g_lpDD_ext; extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; + +/* code from lgd3d.h */ + +#define LGRT_SINGLE_TEXTURE_SINGLE_PASS 0L +#define LGRT_MULTI_TEXTURE_SINGLE_PASS 1L + + //NOTE: multipass multitexturing is not supported!!! + + // Capabilities that can be requested: + +#define LGD3DF_SPEW 0x00000002L + +//depth buffer: +#define LGD3DF_ZBUFFER 0x00000001L // Z-buffer +#define LGD3DF_WBUFFER 0x00000004L // W-buffer +#define LGD3DF_DEPTH_BUFFER_REQUIRED 0x00000008L // the +// selected (Z_ or W-) depth buffer REQUIRED! +//fog: +#define LGD3DF_TABLE_FOG 0x00000010L // table based pixel fog +#define LGD3DF_VERTEX_FOG 0x00000020L + +//dithering +#define LGD3DF_DITHER 0x00000040L // use dithering + +//antialiasing +#define LGD3DF_ANTIALIAS 0x00000080L // use (sort independent) antialiasing + +#define LGD3DF_MULTI_TEXTURING 0x00000100L // we support ONLY two sets of textures and +// and texture coordinates + +#define LGD3DF_MODULATEALPHA 0x00000200L // we want to use modulate alpha for single texture mode +#define LGD3DF_BLENDDIFFUSE 0x00000400L // we want to use blend diffuse for single texture mode + +#define LGD3DF_MULTITEXTURE_COLOR 0x00000800L // we want to use color light maps for single or multi texture mode +#define LGD3DF_MULTITEXTURE_ALPHA 0x00001000L // we want to use alpha light maps for single or multi texture mode + +#define LGD3DF_DO_WINDOWED 0x00002000L + +#define LGD3DF_MT_BLENDDIFFUSE 0x00004000L // we want to use alpha light maps for single or multi texture mode + +// Supported capabilities: (returned by the enumeration) + +//depth buffer +#define LGD3DF_CAN_DO_ZBUFFER 0x00010000L +#define LGD3DF_CAN_DO_WBUFFER 0x00040000L // W-buffer +//fog: +#define LGD3DF_CAN_DO_TABLE_FOG 0x00080000L // table based pixel fog +#define LGD3DF_CAN_DO_VERTEX_FOG 0x00100000L // vertex fog +//dithering +#define LGD3DF_CAN_DO_DITHER 0x00200000L // can dither +#define LGD3DF_CAN_DO_ANTIALIAS 0x00400000L // can use (sort independent) antialiasing + +#define LGD3DF_CAN_DO_SINGLE_PASS_MT 0x02000000L // we can do single pass double texturing +#define LGD3DF_CAN_DO_WINDOWED 0x04000000L // we can play the game in lil' window + +#define LGD3DF_CAN_DO_ITERATE_ALPHA 0x08000000L // can do Gouraud interpolation between vetices alpha color + + +/////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////// + + // Multi texturing + + //used for single level texturing +#define LGD3DTB_MODULATE 0L //default +#define LGD3DTB_MODULATEALPHA 1L +#define LGD3DTB_BLENDDIFFUSE 2L + +#define LGD3DTB_NO_STATES 3L + + //2 levels texturing: +#define LGD3D_MULTITEXTURE_COLOR 0L //default +#define LGD3D_MULTITEXTURE_ALPHA 1L +#define LGD3D_MULTITEXTURE_BLEND_TEX_ALPHA 2L + +#define LGD3D_MULTITEXTURE_NO_STATES 3L + + // additional sets of texture coordinates are added + typedef struct { + float u, v; + } LGD3D_tex_coord; + + // error codes:( the first argument of "lgd3d_get_error" ) +#define LGD3D_EC_OK 0L +#define LGD3D_EC_DD_KAPUT 1L +#define LGD3D_EC_RESTORE_ALL_SURFS 2L +#define LGD3D_EC_QUERY_D3D 3L +#define LGD3D_EC_GET_DD_CAPS 4L +#define LGD3D_EC_ZBUFF_ENUMERATION 5L +#define LGD3D_EC_CREATE_3D_DEVICE 6L +#define LGD3D_EC_CREATE_VIEWPORT 7L +#define LGD3D_EC_ADD_VIEWPORT 8L +#define LGD3D_EC_SET_VIEWPORT 9L +#define LGD3D_EC_SET_CURR_VP 10L +#define LGD3D_EC_CREATE_BK_MATERIAL 11L +#define LGD3D_EC_SET_BK_MATERIAL 12L +#define LGD3D_EC_GET_BK_MAT_HANDLE 13L +#define LGD3D_EC_GET_SURF_DESC 14L +#define LGD3D_EC_GET_3D_CAPS 15L +#define LGD3D_EC_VD_MPASS_MT 16L +#define LGD3D_EC_VD_S_DEFAULT 17L +#define LGD3D_EC_VD_SPASS_MT 18L +#define LGD3D_EC_VD_M_DEFAULT 19L +#define LGD3D_EC_VD_SPASS_BLENDDIFFUSE 20L +#define LGD3D_EC_VD_MPASS_BLENDDIFFUSE 21L + +BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult); +extern int bSpewOn; +extern char* GetDDErrorMsg(int hRes); +extern int g_bPrefer_RGB; + +extern void SetLGD3DErrorCode(ulong dwCode, long hRes); +extern char* GetLgd3dErrorCode(ulong dwErrorCode); + +extern BOOL lgd3d_g_bInitialized; From f420359ec4a61030a3f9974f8c66b5c194ca31e5 Mon Sep 17 00:00:00 2001 From: shad0ff Date: Thu, 27 Jun 2024 20:10:32 +0300 Subject: [PATCH 13/35] fix variables --- libsrc/lgd3d/d6Base.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index 1c86dbc..1c97648 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -1,10 +1,13 @@ -#include +//#include "lgSS2P.h" #include "d6States.h" #include +unsigned long dwErrorCode; +unsigned long hD3DError; + static BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult) { if (!dwErrorCode) From 093e6593a5a27a30d4983eb6aa54980198a72ff9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 27 Jun 2024 22:58:21 +0300 Subject: [PATCH 14/35] lgd3d fixes --- libsrc/lgd3d/d6Base.cpp | 513 ++++++++++++++++++++++++++++++++++----- libsrc/lgd3d/d6Enum.cpp | 288 +++++++++++++++++++++- libsrc/lgd3d/d6Frame.cpp | 426 ++++++++++++++++++++++++++++++-- libsrc/lgd3d/d6Intfc.cpp | 8 +- libsrc/lgd3d/d6Prim.h | 2 + libsrc/lgd3d/lgSurf.cpp | 11 +- libsrc/lgd3d/lgSurf_i.h | 367 +++++++++++++++++++++++----- libsrc/lgd3d/texmgr.cpp | 2 +- 8 files changed, 1457 insertions(+), 160 deletions(-) diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index 1c97648..ea793c5 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -1,14 +1,14 @@ +#include -//#include "lgSS2P.h" +#include -#include "d6States.h" +#include +#include -#include +static DWORD dwErrorCode; +static int hD3DError; -unsigned long dwErrorCode; -unsigned long hD3DError; - -static BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult) +BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult) { if (!dwErrorCode) return FALSE; @@ -19,61 +19,460 @@ static BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult) return TRUE; } -void SetLGD3DErrorCode(DWORD dwCode, long hRes) +void SetLGD3DErrorCode(DWORD dwCode, DWORD hResult) { dwErrorCode = dwCode; - hD3DError = hRes; + hD3DError = hResult; } -// делаешь совместимость с компилятором от 22 студии? к чему тогда такая точность реверса?? -const char *GetLgd3dErrorCode(DWORD dwErrorCode) +const char* GetLgd3dErrorCode(DWORD dwErrorCode) { - switch (dwErrorCode) - { - case LGD3D_EC_DD_KAPUT: - return (char*)"Could not obtain DirectDraw from display"; - case LGD3D_EC_RESTORE_ALL_SURFS: - return (char*)"Could not restore all surfaces"; - case LGD3D_EC_QUERY_D3D: - return (char*)"QueryInterface for D3D failed"; - case LGD3D_EC_GET_DD_CAPS: - return (char*)" GetCaps for DirectDraw failed"; - case LGD3D_EC_ZBUFF_ENUMERATION: - return (char*)" Could not enumerate Zbuffer formats"; - case LGD3D_EC_CREATE_3D_DEVICE: - return (char*)"Create D3D device failed"; - case LGD3D_EC_CREATE_VIEWPORT: - return (char*)"Creation of thr viewport failed"; - case LGD3D_EC_ADD_VIEWPORT: - return (char*)" Addition of the viewport failed"; - case LGD3D_EC_SET_VIEWPORT: - return (char*)"Setting of the viewport2 failed"; - case LGD3D_EC_SET_CURR_VP: - return (char*)"Setting of current viewport failed"; - case LGD3D_EC_CREATE_BK_MATERIAL: - return (char*)"Creation of the background material failed"; - case LGD3D_EC_SET_BK_MATERIAL: - return (char*)"Setting of the background material failed"; - case LGD3D_EC_GET_BK_MAT_HANDLE: - return (char*)"Could not obtain a material handle"; - case LGD3D_EC_GET_SURF_DESC: - return (char*)"Could not get surface description"; - case LGD3D_EC_GET_3D_CAPS: - return (char*)"Could not get D3D device caps"; - case LGD3D_EC_VD_MPASS_MT: - return (char*)"ValidateDevice for multipass lightmaps failed"; - case LGD3D_EC_VD_S_DEFAULT: - return (char*)"ValidateDevice for simple states failed"; - case LGD3D_EC_VD_SPASS_MT: - return (char*)"ValidateDevice for single pass lightmaps failed"; - case LGD3D_EC_VD_M_DEFAULT: - return (char*)"ValidateDevice for multitexture states failed"; - default: - return (char*)"Unknown error"; - } + assert(dwErrorCode != LGD3D_EC_OK); + + switch (dwErrorCode) + { + case LGD3D_EC_DD_KAPUT: + return "Could not obtain DirectDraw from display"; + case LGD3D_EC_RESTORE_ALL_SURFS: + return "Could not restore all surfaces"; + case LGD3D_EC_QUERY_D3D: + return "QueryInterface for D3D failed"; + case LGD3D_EC_GET_DD_CAPS: + return " GetCaps for DirectDraw failed"; + case LGD3D_EC_ZBUFF_ENUMERATION: + return " Could not enumerate Zbuffer formats"; + case LGD3D_EC_CREATE_3D_DEVICE: + return "Create D3D device failed"; + case LGD3D_EC_CREATE_VIEWPORT: + return "Creation of the viewport failed"; + case LGD3D_EC_ADD_VIEWPORT: + return " Addition of the viewport failed"; + case LGD3D_EC_SET_VIEWPORT: + return "Setting of the viewport2 failed"; + case LGD3D_EC_SET_CURR_VP: + return "Setting of current viewport failed"; + case LGD3D_EC_CREATE_BK_MATERIAL: + return "Creation of the background material failed"; + case LGD3D_EC_SET_BK_MATERIAL: + return "Setting of the background material failed"; + case LGD3D_EC_GET_BK_MAT_HANDLE: + return "Could not obtain a material handle"; + case LGD3D_EC_GET_SURF_DESC: + return "Could not get surface description"; + case LGD3D_EC_GET_3D_CAPS: + return "Could not get D3D device caps"; + case LGD3D_EC_VD_MPASS_MT: + return "ValidateDevice for multipass lightmaps failed"; + case LGD3D_EC_VD_S_DEFAULT: + return "ValidateDevice for simple states failed"; + case LGD3D_EC_VD_SPASS_MT: + return "ValidateDevice for single pass lightmaps failed"; + case LGD3D_EC_VD_M_DEFAULT: + return "ValidateDevice for multitexture states failed"; + case LGD3D_EC_VD_SPASS_BLENDDIFFUSE: // maybe unused + return "ValidateDevice for single pass blend diffuse failed"; + case LGD3D_EC_VD_MPASS_BLENDDIFFUSE: // maybe unused + return "ValidateDevice for multipass blend diffuse failed"; + default: + return "Unknown error"; + } } -const char *GetDDErrorMsg(long hRes) +const char* GetDDErrorMsg(long hRes) { - // dx7 error list -} + switch (hRes) + { + case DD_OK: + return "I am OK"; + case DDERR_ALREADYINITIALIZED: + return "This object is already initialized."; + case DDERR_CANNOTATTACHSURFACE: + return "This surface can not be attached to the requested surface."; + case DDERR_CANNOTDETACHSURFACE: + return "This surface can not be detached from the requested surface."; // new + case DDERR_CURRENTLYNOTAVAIL: + return "Support is currently not available."; + case DDERR_EXCEPTION: + return "An exception was encountered while performing the requested operation."; + case DDERR_GENERIC: + return "Generic failure."; + case DDERR_HEIGHTALIGN: + return "Height of rectangle provided is not a multiple of reqd alignment."; + case DDERR_INCOMPATIBLEPRIMARY: + return "Unable to match primary surface creation request with existing primary surface."; + case DDERR_INVALIDCAPS: + return "One or more of the caps bits passed to the callback are incorrect."; + case DDERR_INVALIDCLIPLIST: + return "DirectDraw does not support the provided cliplist."; + case DDERR_INVALIDMODE: + return "DirectDraw does not support the requested mode."; + case DDERR_INVALIDOBJECT: + return "DirectDraw received a pointer that was an invalid DIRECTDRAW object."; + case DDERR_INVALIDPARAMS: + return "One or more of the parameters passed to the function are incorrect."; + case DDERR_INVALIDPIXELFORMAT: + return "The pixel format was invalid as specified."; + case DDERR_INVALIDRECT: + return "Rectangle provided was invalid."; + case DDERR_LOCKEDSURFACES: + return "Operation could not be carried out because one or more surfaces are locked."; + case DDERR_NO3D: + return "There is no 3D present."; + case DDERR_NOALPHAHW: + return "Operation could not be carried out because there is no alpha accleration hardware present or available."; + case DDERR_NOSTEREOHARDWARE: + return "Operation could not be carried out because there is no stereo hardware present or available."; // new + case DDERR_NOSURFACELEFT: + return "Operation could not be carried out because there is no hardware present which supports stereo surfaces"; // new + case DDERR_NOCLIPLIST: + return "No cliplist available."; + case DDERR_NOCOLORCONVHW: + return "Operation could not be carried out because there is no color conversion hardware present or available."; + case DDERR_NOCOOPERATIVELEVELSET: + return "Create function called without DirectDraw object method SetCooperativeLevel being called."; + case DDERR_NOCOLORKEY: + return "Surface doesn't currently have a color key"; + case DDERR_NOCOLORKEYHW: + return "Operation could not be carried out because there is no hardware support of the destination color key."; + case DDERR_NODIRECTDRAWSUPPORT: + return "No DirectDraw support possible with current display driver."; + case DDERR_NOEXCLUSIVEMODE: + return "Operation requires the application to have exclusive mode but the application does not have exclusive mode."; + case DDERR_NOFLIPHW: + return "Flipping visible surfaces is not supported."; + case DDERR_NOGDI: + return "There is no GDI present."; + case DDERR_NOMIRRORHW: + return "Operation could not be carried out because there is no hardware present or available."; + case DDERR_NOTFOUND: + return "Requested item was not found."; + case DDERR_NOOVERLAYHW: + return "Operation could not be carried out because there is no overlay hardware present or available."; + case DDERR_OVERLAPPINGRECTS: + return "Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other."; + case DDERR_NORASTEROPHW: + return "Operation could not be carried out because there is no appropriate raster op hardware present or available."; + case DDERR_NOROTATIONHW: + return "Operation could not be carried out because there is no rotation hardware present or available."; + case DDERR_NOSTRETCHHW: + return "Operation could not be carried out because there is no hardware support for stretching."; + case DDERR_NOT4BITCOLOR: + return "DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette."; + case DDERR_NOT4BITCOLORINDEX: + return "DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette."; + case DDERR_NOT8BITCOLOR: + return "DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color."; + case DDERR_NOTEXTUREHW: + return "Operation could not be carried out because there is no texture mapping hardware present or available."; + case DDERR_NOVSYNCHW: + return "Operation could not be carried out because there is no hardware support for vertical blank synchronized operations."; + case DDERR_NOZBUFFERHW: + return "Operation could not be carried out because there is no hardware support for zbuffer blitting."; + case DDERR_NOZOVERLAYHW: + return "Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays."; + case DDERR_OUTOFCAPS: + return "The hardware needed for the requested operation has already been allocated."; + case DDERR_OUTOFMEMORY: + return "DirectDraw does not have enough memory to perform the operation."; + case DDERR_OUTOFVIDEOMEMORY: + return "DirectDraw does not have enough video memory to perform the operation."; + case DDERR_OVERLAYCANTCLIP: + return "The hardware does not support clipped overlays."; + case DDERR_OVERLAYCOLORKEYONLYONEACTIVE: + return "Can only have ony color key active at one time for overlays."; + case DDERR_PALETTEBUSY: + return "Access to this palette is being refused because the palette is already locked by another thread."; + case DDERR_COLORKEYNOTSET: + return "No src color key specified for this operation."; + case DDERR_SURFACEALREADYATTACHED: + return "This surface is already attached to the surface it is being attached to."; + case DDERR_SURFACEALREADYDEPENDENT: + return "This surface is already a dependency of the surface it is being made a dependency of."; + case DDERR_SURFACEBUSY: + return "Access to this surface is being refused because the surface is already locked by another thread."; + case DDERR_CANTLOCKSURFACE: + return "Access to this surface is being refused because no driver exists which can supply a pointer to the surface."; + case DDERR_SURFACEISOBSCURED: + return "Access to surface refused because the surface is obscured."; + case DDERR_SURFACELOST: + return "Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it."; + case DDERR_SURFACENOTATTACHED: + return "The requested surface is not attached."; + case DDERR_TOOBIGHEIGHT: + return "Height requested by DirectDraw is too large."; + case DDERR_TOOBIGSIZE: + return "Size requested by DirectDraw is too large, but the individual height and width are OK."; + case DDERR_TOOBIGWIDTH: + return "Width requested by DirectDraw is too large."; + case DDERR_UNSUPPORTED: + return "Action not supported."; + case DDERR_UNSUPPORTEDFORMAT: + return "FOURCC format requested is unsupported by DirectDraw."; + case DDERR_UNSUPPORTEDMASK: + return "Bitmask in the pixel format requested is unsupported by DirectDraw."; + case DDERR_INVALIDSTREAM: + return "The specified stream contains invalid data."; + case DDERR_VERTICALBLANKINPROGRESS: + return "Vertical blank is in progress."; + case DDERR_WASSTILLDRAWING: + return "Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete."; + case DDERR_DDSCAPSCOMPLEXREQUIRED: + return "The specified surface type requires specification of the COMPLEX flag"; // new + case DDERR_XALIGN: + return "Rectangle provided was not horizontally aligned on required boundary."; + case DDERR_INVALIDDIRECTDRAWGUID: + return "The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier."; + case DDERR_DIRECTDRAWALREADYCREATED: + return "A DirectDraw object representing this driver has already been created for this process."; + case DDERR_NODIRECTDRAWHW: + return "A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware."; + case DDERR_PRIMARYSURFACEALREADYEXISTS: + return "This process already has created a primary surface."; + case DDERR_NOEMULATION: + return "Software emulation not available."; + case DDERR_REGIONTOOSMALL: + return "Region passed to Clipper::GetClipList is too small."; + case DDERR_CLIPPERISUSINGHWND: + return "An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd."; + case DDERR_NOCLIPPERATTACHED: + return "No clipper object attached to surface object."; + case DDERR_NOHWND: + return "Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND."; + case DDERR_HWNDSUBCLASSED: + return "HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state."; + case DDERR_HWNDALREADYSET: + return "The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created."; + case DDERR_NOPALETTEATTACHED: + return "No palette object attached to this surface."; + case DDERR_NOPALETTEHW: + return "No hardware support for 16 or 256 color palettes."; + case DDERR_BLTFASTCANTCLIP: + return "Return if a clipper object is attached to the source surface passed into a BltFast call."; + case DDERR_NOBLTHW: + return "No blitter hardware present."; + case DDERR_NODDROPSHW: + return "No DirectDraw ROP hardware."; + case DDERR_OVERLAYNOTVISIBLE: + return "Returned when GetOverlayPosition is called on a hidden overlay."; + case DDERR_NOOVERLAYDEST: + return "Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination."; + case DDERR_INVALIDPOSITION: + return "Returned when the position of the overlay on the destination is no longer legal for that destination."; + case DDERR_NOTAOVERLAYSURFACE: + return "Returned when an overlay member is called for a non-overlay surface."; + case DDERR_EXCLUSIVEMODEALREADYSET: + return "An attempt was made to set the cooperative level when it was already set to exclusive."; + case DDERR_NOTFLIPPABLE: + return "An attempt has been made to flip a surface that is not flippable."; + case DDERR_CANTDUPLICATE: + return "Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created."; + case DDERR_NOTLOCKED: + return "Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this process, has been attempted."; + case DDERR_CANTCREATEDC: + return "Windows can not create any more DCs, or a DC was requested for a paltte-indexed surface when the surface had no palette AND the display mode was not palette-indexed."; + case DDERR_NODC: + return "No DC was ever created for this surface."; + case DDERR_WRONGMODE: + return "This surface can not be restored because it was created in a different mode."; + case DDERR_IMPLICITLYCREATED: + return "This surface can not be restored because it is an implicitly created surface."; + case DDERR_NOTPALETTIZED: + return "The surface being used is not a palette-based surface."; + case DDERR_UNSUPPORTEDMODE: + return "The display is currently in an unsupported mode."; + case DDERR_NOMIPMAPHW: + return "Operation could not be carried out because there is no mip-map texture mapping hardware present or available."; + case DDERR_INVALIDSURFACETYPE: + return "The requested action could not be performed because the surface was of the wrong type."; + case DDERR_NOOPTIMIZEHW: + return "Device does not support optimized surfaces, therefore no video memory optimized surfaces."; + case DDERR_NOTLOADED: + return "Surface is an optimized surface, but has not yet been allocated any memory."; + case DDERR_NOFOCUSWINDOW: + return "Attempt was made to create or set a device window without first setting the focus window."; + case DDERR_NOTONMIPMAPSUBLEVEL: + return "Attempt was made to set a palette on a mipmap sublevel"; // new + case DDERR_DCALREADYCREATED: + return "A DC has already been returned for this surface. Only one DC can be retrieved per surface."; + case DDERR_NONONLOCALVIDMEM: + return "An attempt was made to allocate non-local video memory from a device that does not support non-local video memory."; + case DDERR_CANTPAGELOCK: + return "The attempt to page lock a surface failed."; + case DDERR_CANTPAGEUNLOCK: + return "The attempt to page unlock a surface failed."; + case DDERR_NOTPAGELOCKED: + return "An attempt was made to page unlock a surface with no outstanding page locks."; + case DDERR_MOREDATA: + return "There is more data available than the specified buffer size could hold."; + case DDERR_EXPIRED: + return "The data has expired and is therefore no longer valid."; + case DDERR_TESTFINISHED: + return "The mode test has finished executing."; // new + case DDERR_NEWMODE: + return "The mode test has switched to a new mode."; // new + case DDERR_D3DNOTINITIALIZED: + return "D3D has not yet been initialized."; // new + case DDERR_VIDEONOTACTIVE: + return "The video port is not active."; + case DDERR_NOMONITORINFORMATION: + return "The monitor does not have EDID data."; // new + case DDERR_NODRIVERSUPPORT: + return "The driver does not enumerate display mode refresh rates."; // new + case DDERR_DEVICEDOESNTOWNSURFACE: + return "Surfaces created by one direct draw device cannot be used directly by another direct draw device."; + case DDERR_NOTINITIALIZED: + return "An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized."; + case D3DERR_BADMAJORVERSION: + return "The service that you requested is unavailable in this major version of DirectX."; + case D3DERR_BADMINORVERSION: + return "The service that you requested is available in this major version of DirectX, but not in this minor version."; + case D3DERR_INVALID_DEVICE: + return "The requested device type is not valid."; + case D3DERR_INITFAILED: + return "A rendering device could not be created because the new device could not be initialized."; + case D3DERR_DEVICEAGGREGATED: + return "The SetRenderTarget method was called on a device that was retrieved from the render target surface."; + case D3DERR_EXECUTE_CREATE_FAILED: + return "The execute buffer could not be created. This typically occurs when no memory is available to allocate the execute buffer."; + case D3DERR_EXECUTE_DESTROY_FAILED: + return "The memory for the execute buffer could not be deallocated."; + case D3DERR_EXECUTE_LOCK_FAILED: + return "The execute buffer could not be locked."; + case D3DERR_EXECUTE_UNLOCK_FAILED: + return "D3DERR_EXECUTE_UNLOCK_FAILED"; + case D3DERR_EXECUTE_LOCKED: + return "The execute buffer could not be unlocked."; + case D3DERR_EXECUTE_NOT_LOCKED: + return "The execute buffer could not be unlocked because it is not currently locked."; + case D3DERR_EXECUTE_FAILED: + return "The contents of the execute buffer are invalid and cannot be executed."; + case D3DERR_EXECUTE_CLIPPED_FAILED: + return "The execute buffer could not be clipped during execution."; + case D3DERR_TEXTURE_NO_SUPPORT: + return "The device does not support texture mapping."; + case D3DERR_TEXTURE_CREATE_FAILED: + return "The texture handle for the texture could not be retrieved from the driver."; + case D3DERR_TEXTURE_DESTROY_FAILED: + return "The device was unable to deallocate the texture memory."; + case D3DERR_TEXTURE_LOCK_FAILED: + return "The texture could not be locked."; + case D3DERR_TEXTURE_UNLOCK_FAILED: + return "The texture surface could not be unlocked."; + case D3DERR_TEXTURE_LOAD_FAILED: + return "The texture could not be loaded."; + case D3DERR_TEXTURE_SWAP_FAILED: + return "The texture handles could not be swapped."; + case D3DERR_TEXTURE_LOCKED: + return "The requested operation could not be completed because the texture surface is currently locked."; + case D3DERR_TEXTURE_NOT_LOCKED: + return "The requested operation could not be completed because the texture surface is not locked."; + case D3DERR_TEXTURE_GETSURF_FAILED: + return "The DirectDraw surface used to create the texture could not be retrieved."; + case D3DERR_MATRIX_CREATE_FAILED: + return "The matrix could not be created. This can occur when no memory is available to allocate for the matrix."; + case D3DERR_MATRIX_DESTROY_FAILED: + return "The memory for the matrix could not be deallocated."; + case D3DERR_MATRIX_SETDATA_FAILED: + return "The matrix data could not be set. This can occur when the matrix was not created by the current device."; + case D3DERR_MATRIX_GETDATA_FAILED: + return "The matrix data could not be retrieved. This can occur when the matrix was not created by the current device."; + case D3DERR_SETVIEWPORTDATA_FAILED: + return "The viewport parameters could not be set."; + case D3DERR_INVALIDCURRENTVIEWPORT: + return "The currently selected viewport is not valid."; + case D3DERR_INVALIDPRIMITIVETYPE: + return "The primitive type specified by the application is invalid."; + case D3DERR_INVALIDVERTEXTYPE: + return "The vertex type specified by the application is invalid."; + case D3DERR_TEXTURE_BADSIZE: + return "The dimensions of a current texture are invalid. This can occur when an application attempts to use a texture that has dimensions that are not a power of 2 with a device that requires them."; + case D3DERR_INVALIDRAMPTEXTURE: + return "Ramp mode is being used, and the texture handle in the current material does not match the current texture handle that is set as a render state."; + case D3DERR_MATERIAL_CREATE_FAILED: + return "The material could not be created. This typically occurs when no memory is available to allocate for the material."; + case D3DERR_MATERIAL_DESTROY_FAILED: + return "The memory for the material could not be deallocated."; + case D3DERR_MATERIAL_SETDATA_FAILED: + return "The material parameters could not be set."; + case D3DERR_MATERIAL_GETDATA_FAILED: + return "The material parameters could not be retrieved."; + case D3DERR_INVALIDPALETTE: + return "The palette associated with a surface is invalid."; + case D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY: + return "The requested operation could not be completed because the specified device requires system-memory depth-buffer surfaces."; + case D3DERR_ZBUFF_NEEDS_VIDEOMEMORY: + return "The requested operation could not be completed because the specified device requires video-memory depth-buffer surfaces."; + case D3DERR_SURFACENOTINVIDMEM: + return "The device could not be created because the render target surface is not located in video memory."; + case D3DERR_LIGHT_SET_FAILED: + return "The attempt to set lighting parameters for a light object failed."; + case D3DERR_LIGHTHASVIEWPORT: + return "The requested operation failed because the light object is associated with another viewport."; + case D3DERR_LIGHTNOTINTHISVIEWPORT: + return "The requested operation failed because the light object has not been associated with this viewport."; + case D3DERR_SCENE_IN_SCENE: + return "Scene rendering could not begin because a previous scene was not completed by a call to the EndScene method."; + case D3DERR_SCENE_NOT_IN_SCENE: + return "Scene rendering could not be completed because a scene was not started by a previous call to the BeginScene method."; + case D3DERR_SCENE_BEGIN_FAILED: + return "Scene rendering could not begin."; + case D3DERR_SCENE_END_FAILED: + return "Scene rendering could not be completed."; + case D3DERR_INBEGIN: + return "The requested operation cannot be completed while scene rendering is taking place."; + case D3DERR_NOTINBEGIN: + return "The requested rendering operation could not be completed because scene rendering has not begun."; + case D3DERR_NOVIEWPORTS: + return "The requested operation failed because the device currently has no viewports associated with it."; + case D3DERR_VIEWPORTDATANOTSET: + return "The requested operation could not be completed because viewport parameters have not yet been set."; + case D3DERR_VIEWPORTHASNODEVICE: + return "This value is used only by the IDirect3DDevice3 interface and its predecessors. For the IDirect3DDevice7 interface, this error value is not used."; + case D3DERR_NOCURRENTVIEWPORT: + return "The viewport parameters could not be retrieved because none have been set."; + case D3DERR_INVALIDVERTEXFORMAT: + return "The combination of flexible vertex format flags specified by the application is not valid."; + case D3DERR_COLORKEYATTACHED: + return "Attempted to CreateTexture on a surface that had a color key."; + case D3DERR_VERTEXBUFFEROPTIMIZED: + return "The requested operation could not be completed because the vertex buffer is optimized."; + case D3DERR_VBUF_CREATE_FAILED: + return "The vertex buffer could not be created. This can happen when there is insufficient memory to allocate a vertex buffer."; + case D3DERR_VERTEXBUFFERLOCKED: + return "The requested operation could not be completed because the vertex buffer is locked."; + case D3DERR_ZBUFFER_NOTPRESENT: + return "The requested operation could not be completed because the render target surface does not have an attached depth buffer."; + case D3DERR_STENCILBUFFER_NOTPRESENT: + return "The requested stencil buffer operation could not be completed because there is no stencil buffer attached to the render target surface."; + case D3DERR_WRONGTEXTUREFORMAT: + return "The pixel format of the texture surface is not valid."; + case D3DERR_UNSUPPORTEDCOLOROPERATION: + return "The device does not support one of the specified texture-blending operations for color values."; + case D3DERR_UNSUPPORTEDCOLORARG: + return "The device does not support one of the specified texture-blending arguments for color values."; + case D3DERR_UNSUPPORTEDALPHAOPERATION: + return "The device does not support one of the specified texture-blending operations for the alpha channel."; + case D3DERR_UNSUPPORTEDALPHAARG: + return "The device does not support one of the specified texture-blending arguments for the alpha channel."; + case D3DERR_TOOMANYOPERATIONS: + return "The application is requesting more texture-filtering operations than the device supports."; + case D3DERR_CONFLICTINGTEXTUREFILTER: + return "The current texture filters cannot be used together."; + case D3DERR_UNSUPPORTEDFACTORVALUE: + return "The specified texture factor value is not supported by the device."; + case D3DERR_CONFLICTINGRENDERSTATE: + return "The currently set render states cannot be used together."; + case D3DERR_UNSUPPORTEDTEXTUREFILTER: + return "The specified texture filter is not supported by the device."; + case D3DERR_TOOMANYPRIMITIVES: + return "The device is unable to render the provided number of primitives in a single pass."; + case D3DERR_INVALIDMATRIX: + return "The requested operation could not be completed because the combination of the currently set world, view, and projection matrices is invalid"; + case D3DERR_TOOMANYVERTICES: + return "D3DERR_TOOMANYVERTICES"; + case D3DERR_CONFLICTINGTEXTUREPALETTE: + return "The current textures cannot be used simultaneously."; + default: + return "Unrecognized error value."; + } +} \ No newline at end of file diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp index 1700c82..01fecc7 100644 --- a/libsrc/lgd3d/d6Enum.cpp +++ b/libsrc/lgd3d/d6Enum.cpp @@ -3,15 +3,279 @@ #include #include -IDirect3DDevice3* g_lpD3Ddevice; -int bSpewOn; - -int lgd3d_enumerate_devices(); -int lgd3d_enumerate_devices_capable_of(unsigned long flags); -void lgd3d_unenumerate_devices(); -lgd3ds_device_info *lgd3d_get_device_info(int device_number); - -int c_DDEnumCallback(GUID *lpGUID, const char *lpDriverDescription, const char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); -void GetDevices(LGD3D_sEnumerationInfo *info); -int c_EnumDisplayModesCallback(DDSURFACEDESC2 *pSD, char *data); -int c_EnumDevicesCallback(GUID *lpGuid, const char *lpDeviceDescription, const char *lpDeviceName, D3DDEVICEDESC *pDeviceDesc, D3DDEVICEDESC *lpD3DHELDeviceDesc, void *lpUserArg); +#include +#include +#include +#include +#include +#include + +static bool bWBuffer; +static int nNoDevices = -2; +static lgd3ds_device_info* psDeviceList[10]; +static bool bNoD3d = true; +static bool bDepthBuffer = false; +static bool bWindowed = false; + +struct LGD3D_sEnumerationInfo +{ + GUID* p_ddraw_guid; + int device_number; + char* p_ddraw_desc; + uint16 supported_modes[GRD_MODES]; + int num_supported; + DWORD requested_flags; +}; + +int lgd3d_enumerate_devices() +{ + return lgd3d_enumerate_devices_capable_of(0); +} + +int lgd3d_enumerate_devices_capable_of(unsigned long flags) +{ + LGD3D_sEnumerationInfo sDEinfo = {}; + + if (nNoDevices >= -1) + return nNoDevices; + + if (!LoadDirectDraw()) + { + nNoDevices = -1; + return nNoDevices; + } + + sDEinfo.device_number = 0; + sDEinfo.requested_flags = flags; + DynDirectDrawEnumerate(c_DDEnumCallback, &sDEinfo); + if (!bNoD3d || sDEinfo.device_number) + nNoDevices = sDEinfo.device_number; + else + nNoDevices = -1; + + return nNoDevices; +} + +void lgd3d_unenumerate_devices() +{ + for (int i = 0; i < nNoDevices; ++i) + { + delete psDeviceList; // FIXME char[] + psDeviceList[i] = nullptr; + } + + nNoDevices = -2; +} + +lgd3ds_device_info* lgd3d_get_device_info(int device_number) +{ + if (nNoDevices <= device_number) + CriticalMsg1("Invalid device number: %d", device_number); + + return psDeviceList[device_number]; +} + +void GetDevices(LGD3D_sEnumerationInfo* info) +{ + GUID* p_ddraw_guid = info->p_ddraw_guid; + IDirectDraw* lpdd = nullptr; + if (FAILED(DynDirectDrawCreate(p_ddraw_guid, &lpdd, nullptr))) + { + DbgReportWarning("Can't create ddraw object.\n"); + return; + } + + IDirectDraw4* lpdd4 = nullptr; + if (lpdd->QueryInterface(IID_IDirectDraw4, reinterpret_cast(&lpdd4)) != S_OK) + { + DbgReportWarning("Can't obtain DDraw4 interface.\n"); + SafeRelease(lpdd); + return; + } + + DDCAPS ddcaps = {}; + ddcaps.dwSize = sizeof(ddcaps); + if (lpdd4->GetCaps(&ddcaps, nullptr) != DD_OK || (ddcaps.dwCaps & DDCAPS_3D) == 0) + { + DbgReportWarning("Not a 3d accelerator.\n"); + SafeRelease(lpdd4); + SafeRelease(lpdd); + return; + } + + bDepthBuffer = ddcaps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE; + bWindowed = ddcaps.dwCaps2 & DDCAPS2_CANRENDERWINDOWED; + + IDirect3D3* lpd3d = nullptr; + if (lpdd4->QueryInterface(IID_IDirect3D3, reinterpret_cast(&lpd3d)) != S_OK) + { + DbgReportWarning("Can't obtain D3D interface.\n"); + SafeRelease(lpdd4); + SafeRelease(lpdd); + return; + } + + bNoD3d = false; + info->num_supported = 0; + lpdd4->EnumDisplayModes(0, nullptr, info, c_EnumDisplayModesCallback); + if (info->num_supported <= 0) + { + DbgReportWarning("Couldn't find any display modes.\n"); + } + else if (lpd3d->EnumDevices(c_EnumDevicesCallback, info)) + { + DbgReportWarning("EnumDevices failed.\n"); + } + + SafeRelease(lpd3d); + SafeRelease(lpdd4); + SafeRelease(lpdd); +} + +BOOL CALLBACK c_DDEnumCallback(GUID* lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext) +{ + reinterpret_cast(lpContext)->p_ddraw_guid = lpGUID; + reinterpret_cast(lpContext)->p_ddraw_desc = lpDriverDescription; + GetDevices(reinterpret_cast(lpContext)); + + return TRUE; +} + +HRESULT CALLBACK c_EnumDisplayModesCallback(LPDDSURFACEDESC2 pSD, LPVOID data) +{ + auto* info = reinterpret_cast(data); + + auto mode = gr_mode_from_info(pSD->dwWidth, pSD->dwHeight, pSD->ddpfPixelFormat.dwRGBBitCount); + if (mode < 0) + return 1; + + for (int i = 0; i < info->num_supported; ++i) + if (info->supported_modes[i] == mode) + return 1; + + info->supported_modes[info->num_supported++] = mode; + + return 1; +} + +HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC pDeviceDesc, LPD3DDEVICEDESC lpD3DHELDeviceDesc, LPVOID lpUserArg) +{ + auto* info = reinterpret_cast(lpUserArg); + + if (!pDeviceDesc->dcmColorModel) + return 1; + + DWORD capabilities_flags = 0; + if ((pDeviceDesc->dwDeviceRenderBitDepth & DDBD_16) == 0) + { + mprintf("No 16 bit.\n"); + return 1; + } + + if ((pDeviceDesc->dcmColorModel & D3DCOLOR_RGB) == 0) + { + mprintf("device not RGB.\n"); + return 1; + } + + if ((pDeviceDesc->dpcTriCaps.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) == 0) + { + mprintf("no color gouraud shading.\n"); + return 1; + } + + if ((pDeviceDesc->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_ALPHA) == 0) + { + mprintf("no alpha blending.\n"); + return 1; + } + + if ((pDeviceDesc->dwDevCaps & (D3DDEVCAPS_TEXTURENONLOCALVIDMEM | D3DDEVCAPS_TEXTUREVIDEOMEMORY | D3DDEVCAPS_TEXTURESYSTEMMEMORY)) == 0) + { + mprintf("no texture mapping.\n"); + return 1; + } + + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) != 0) + { + pDeviceDesc->dpcTriCaps.dwRasterCaps &= 0xFE; + } + + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) + { + capabilities_flags = 0x80000; + } + else if (info->requested_flags & 0x10) + { + mprintf("no table fog\n"); + return 1; + } + + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) + { + capabilities_flags |= 0x100000u; + } + else if (info->requested_flags & 0x20) + { + mprintf("no vertex fog\n"); + return 1; + } + + if ((pDeviceDesc->dpcTriCaps.dwShadeCaps & D3DPRASTERCAPS_ZBIAS) != 0) + capabilities_flags |= 0x8000000u; + + if (bDepthBuffer) + { + capabilities_flags |= 0x10000u; + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) != 0) + capabilities_flags |= 0x40000u; + } + + if (bWindowed) + capabilities_flags |= 0x4000000u; + + if (pDeviceDesc->wMaxTextureBlendStages >= 2 && pDeviceDesc->wMaxSimultaneousTextures >= 2 && pDeviceDesc->dwFVFCaps >= 2) + capabilities_flags |= 0x2000000u; + + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) != 0) + capabilities_flags |= 0x200000u; + + if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) != 0) + capabilities_flags |= 0x400000u; + + if (info->device_number >= 10) + CriticalMsg("Too many d3d devices available."); + + lgd3ds_device_info* device_info; + auto malloc_size = strlen(info->p_ddraw_desc) + sizeof(short) * info->num_supported + 291; + if (info->p_ddraw_guid) + { + device_info = reinterpret_cast(new char[malloc_size + sizeof(GUID)]); + device_info->p_ddraw_guid = reinterpret_cast((reinterpret_cast(device_info) + sizeof(malloc_size))); + memcpy(device_info->p_ddraw_guid, info->p_ddraw_guid, sizeof(GUID)); + } + else + { + device_info = reinterpret_cast(new char[malloc_size]); + device_info->p_ddraw_guid = nullptr; + } + + memcpy(&device_info->device_guid, lpGuid, sizeof(GUID)); + + device_info->supported_modes = (short*)&device_info[1]; + if (info->num_supported > 0) + memcpy(device_info->supported_modes, info->supported_modes, 2 * info->num_supported); + device_info->supported_modes[info->num_supported] = -1; + + device_info->device_desc = (DevDesc*)&device_info->supported_modes[info->num_supported + 1]; + memcpy(device_info->device_desc, pDeviceDesc, sizeof(DevDesc)); + + device_info->p_ddraw_desc = (char*)&device_info->device_desc[1]; + strcpy(device_info->p_ddraw_desc, info->p_ddraw_desc); + + device_info->flags = capabilities_flags; + + psDeviceList[info->device_number++] = device_info; + + return 1; +} diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp index 8667db1..dbce88c 100644 --- a/libsrc/lgd3d/d6Frame.cpp +++ b/libsrc/lgd3d/d6Frame.cpp @@ -1,68 +1,442 @@ #include +#include #include +#include +#include +#include +#include #include +#include +#include +#include -DevDesc g_sD3DDevDesc; -IDirectDraw4* g_lpDD_ext; +IDirectDraw4* g_lpDD_ext = nullptr; +IDirectDrawSurface4* g_lpRenderBuffer = nullptr; +IDirectDrawSurface4* g_lpDepthBuffer = nullptr; +IDirect3DDevice3* g_lpD3Ddevice = nullptr; -class cD6Frame { +extern bool lgd3d_g_bInitialized; +bool bSpewOn; +int g_bWFog; + +DWORD g_dwScreenWidth; +DWORD g_dwScreenHeight; +D3DMATERIALHANDLE g_hBackgroundMaterial; +DDPIXELFORMAT g_RGBTextureFormat; +DDSURFACEDESC2 g_sDescOfRenderBuffer; +D3DDEVICEDESC g_sD3DDevDesc; +DDPIXELFORMAT g_sDDPFDepth; +DDPIXELFORMAT* g_FormatList[5]; + +float g_XOffset; +float g_YOffset; +int g_bUseDepthBuffer; +int g_bUseTableFog; +int g_bUseVertexFog; + +cD6Renderer* pcRenderer; +IDirect3D3* g_lpD3D; +IDirect3DViewport3* g_lpViewport; +IDirect3DMaterial3* g_lpBackgroundMaterial; +int g_b8888supported; + + +static inline void RaiseLGD3DErrorCode(DWORD dwCode, DWORD hResult) +{ + SetLGD3DErrorCode(dwCode, hResult); + if (bSpewOn) + CriticalMsg4("LGD3D error no %d : %s : message: %d\n%s ", dwCode, GetLgd3dErrorCode(dwCode), hResult, GetDDErrorMsg(hResult)); + else + DbgReportWarning("LGD3D error no %d : %s : message: %d\n%s ", dwCode, GetLgd3dErrorCode(dwCode), hResult, GetDDErrorMsg(hResult)); + + lgd3d_g_bInitialized = false; +} + +class cD6Frame +{ public: - cD6Frame(ILGSurface *pILGSurface); - cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info *psDeviceInfo); - ~cD6Frame(); + cD6Frame(ILGSurface* pILGSurface); + cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info* psDeviceInfo); + ~cD6Frame(); private: - void InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags); - void InitializeEnvironment(lgd3ds_device_info *psDeviceInfo); - long GetDDstuffFromDisplay(); - long CreateDepthBuffer(); - int CreateD3D(const GUID & sDeviceGUID); - void ExamineRenderingCapabilities(); + void InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags); + void InitializeEnvironment(lgd3ds_device_info* psDeviceInfo); + HRESULT GetDDstuffFromDisplay(); + HRESULT CreateDepthBuffer(); + int CreateD3D(const GUID& sDeviceGUID); + void ExamineRenderingCapabilities(); private: - DWORD m_dwRequestedFlags; - int m_bDepthBuffer; - DWORD m_dwTextureOpCaps; - IWinDisplayDevice * m_pWinDisplayDevice; + DWORD m_dwRequestedFlags; + bool m_bDepthBuffer; + DWORD m_dwTextureOpCaps; + IWinDisplayDevice* m_pWinDisplayDevice; }; -cD6Frame::cD6Frame(ILGSurface *pILGSurface) +cD6Frame::cD6Frame(ILGSurface* pILGSurface) { + auto dwWidth = pILGSurface->GetWidth(); + auto dwHeight = pILGSurface->GetHeight(); + + ILGDD4Surface* pIlgdd4surface = nullptr; + if (pILGSurface->QueryInterface(IID_ILGDD4Surface, reinterpret_cast(&pIlgdd4surface)) < 0) + CriticalMsg("Failed to query ILGDD4Surface interface"); + + auto nDeviceIndex = pIlgdd4surface->GetDeviceInfoIndex(); + auto* psDeviceInfo = lgd3d_get_device_info(nDeviceIndex); + InitializeGlobals(dwWidth, dwHeight, psDeviceInfo->flags); + + pIlgdd4surface->GetDirectDraw(&g_lpDD_ext); + if (!g_lpDD_ext) + CriticalMsg("cD6Frame: GetDirectDraw failed"); + + pIlgdd4surface->GetRenderSurface(&g_lpRenderBuffer); + if (!g_lpRenderBuffer) + CriticalMsg("cD6Frame: GetRenderSurface failed"); + + SafeRelease(pIlgdd4surface); + + InitializeEnvironment(psDeviceInfo); } -cD6Frame::cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info *psDeviceInfo) +cD6Frame::cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info* psDeviceInfo) { + InitializeGlobals(dwWidth, dwHeight, psDeviceInfo->flags); + if (FAILED(GetDDstuffFromDisplay())) + { + RaiseLGD3DErrorCode(LGD3D_EC_DD_KAPUT, S_OK); + return; + } + + InitializeEnvironment(psDeviceInfo); } cD6Frame::~cD6Frame() { + pcRenderer = cD6Renderer::DeInstance(); + + SafeRelease(g_lpBackgroundMaterial); + SafeRelease(g_lpViewport); + SafeRelease(g_lpD3Ddevice); + + g_lpRenderBuffer->DeleteAttachedSurface(0, g_lpDepthBuffer); + SafeRelease(g_lpRenderBuffer); + + SafeRelease(g_lpDepthBuffer); + SafeRelease(g_lpD3D); + SafeRelease(g_lpDD_ext); + SafeRelease(m_pWinDisplayDevice); } void cD6Frame::InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags) { + g_dwScreenWidth = dwWidth; + g_dwScreenHeight = dwHeight; + + m_pWinDisplayDevice = nullptr; + g_XOffset = 0.0; + g_YOffset = 0.0; + + g_lpDD_ext = nullptr; + g_lpRenderBuffer = nullptr; + g_lpDepthBuffer = nullptr; + g_lpD3D = nullptr; + g_lpD3Ddevice = nullptr; + g_lpViewport = nullptr; + g_lpBackgroundMaterial = nullptr; + g_hBackgroundMaterial = 0; + g_b8888supported = false; + g_bUseDepthBuffer = dwRequestedFlags & 0x5; + bSpewOn = dwRequestedFlags & 0x2; + g_bUseTableFog = false; + g_bUseVertexFog = false; + + if (dwRequestedFlags & 0x10) + g_bUseTableFog = dwRequestedFlags & 0x80000; + + if (dwRequestedFlags & 0x20) + g_bUseVertexFog = dwRequestedFlags & 0x100000; } -void cD6Frame::InitializeEnvironment(lgd3ds_device_info *psDeviceInfo) +void cD6Frame::InitializeEnvironment(lgd3ds_device_info* psDeviceInfo) { + if (g_lpRenderBuffer->IsLost() == -2005532222) + { + auto hResult = g_lpDD_ext->RestoreAllSurfaces(); + if (FAILED(hResult)) + { + RaiseLGD3DErrorCode(LGD3D_EC_RESTORE_ALL_SURFS, hResult); + return; + } + } + + auto hResult = g_lpDD_ext->QueryInterface(IID_IDirect3D3, reinterpret_cast(&g_lpD3D)); + if (FAILED(hResult)) + { + RaiseLGD3DErrorCode(LGD3D_EC_QUERY_D3D, hResult); + return; + } + + DDCAPS sDDChdw = {}; + sDDChdw.dwSize = sizeof(sDDChdw); + + DDCAPS sDDChel = {}; + sDDChel.dwSize = sizeof(sDDChel); + + hResult = g_lpDD_ext->GetCaps(&sDDChdw, &sDDChel); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_GET_DD_CAPS, hResult); + return; + } + + if ((sDDChdw.dwCaps & DDCAPS_3D) == 0) + CriticalMsg("Not an accelerator."); + + memset(&g_sDescOfRenderBuffer, 0, sizeof(g_sDescOfRenderBuffer)); + g_sDescOfRenderBuffer.dwSize = sizeof(DDSURFACEDESC2); + + hResult = g_lpRenderBuffer->GetSurfaceDesc(&g_sDescOfRenderBuffer); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_GET_SURF_DESC, hResult); + return; + } + + if ((g_sDescOfRenderBuffer.dwFlags & DDSD_CAPS) == 0) + Warning(("cD6Frame: flags indicate caps field not valid!\n")); + + if ((g_sDescOfRenderBuffer.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) != 0) + Warning(("cD6Frame: Rendering to primary surface!\n")); + + m_bDepthBuffer = sDDChdw.ddsCaps.dwCaps & DDSCAPS_ZBUFFER; + if (g_bUseDepthBuffer) + { + if (m_bDepthBuffer) + { + hResult = g_lpD3D->EnumZBufferFormats(psDeviceInfo->device_guid, c_EnumZBufferFormats, &g_sDDPFDepth); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_ZBUFF_ENUMERATION, hResult); + return; + } + + if (CreateDepthBuffer()) + { + Warning(("Could not create Zbuffer\n")); + psDeviceInfo->flags &= ~1u; + psDeviceInfo->flags &= ~4u; + if (psDeviceInfo->flags & 8) + { + lgd3d_g_bInitialized = false; + return; + } + + g_bUseDepthBuffer = false; + } + } + else + { + Warning(("Z-buffer not present\n")); + g_bUseDepthBuffer = false; + psDeviceInfo->flags &= ~1u; + psDeviceInfo->flags &= ~4u; + if (psDeviceInfo->flags & 8) + { + lgd3d_g_bInitialized = false; + return; + } + } + } + + if (CreateD3D(psDeviceInfo->device_guid)) + { + m_dwRequestedFlags = psDeviceInfo->flags; + ExamineRenderingCapabilities(); + psDeviceInfo->flags = m_dwRequestedFlags; + } } -long cD6Frame::GetDDstuffFromDisplay() +HRESULT cD6Frame::GetDDstuffFromDisplay() { - return 0; + m_pWinDisplayDevice = AppGetObj(IWinDisplayDevice); + m_pWinDisplayDevice->GetDirectDraw(&g_lpDD_ext); + if (!g_lpDD_ext) + CriticalMsg("cD6Frame: GetDirectDraw failed"); + + auto hResult = m_pWinDisplayDevice->GetBitmapSurface(nullptr, &g_lpRenderBuffer); + if (FAILED(hResult)) + CriticalMsg("GetBitmapSurface failed."); + + if (!g_lpRenderBuffer) + CriticalMsg("No render surface available."); + + return hResult; } -long cD6Frame::CreateDepthBuffer() +HRESULT cD6Frame::CreateDepthBuffer() { - return 0; + DDSURFACEDESC2 sDDSD; + memcpy(&sDDSD, &g_sDescOfRenderBuffer, sizeof(sDDSD)); + sDDSD.dwFlags = 4103; + sDDSD.ddsCaps.dwCaps = 147456; + + memcpy(&sDDSD.ddpfPixelFormat, &g_sDDPFDepth, sizeof(sDDSD.ddpfPixelFormat)); + + auto hResult = g_lpDD_ext->CreateSurface(&sDDSD, &g_lpDepthBuffer, nullptr); + if (FAILED(hResult)) + { + Warning(("%s: error %d\n%s ", "Failed to create depth buffer\n", hResult, GetDDErrorMsg(hResult))); + return hResult; + } + + hResult = g_lpRenderBuffer->AddAttachedSurface(g_lpDepthBuffer); + if (FAILED(hResult)) + Warning(("%s: error %d\n%s ", "Failed to attach depth buffer\n", hResult, GetDDErrorMsg(hResult))); + + return hResult; } -int cD6Frame::CreateD3D(const GUID &sDeviceGUID) +int cD6Frame::CreateD3D(const GUID& sDeviceGUID) { - return 0; + if (!g_lpDD_ext) + CriticalMsg("cD6Frame::CreateD3D: DirectDraw Not Initialized."); + + if (!g_lpD3D) + CriticalMsg("cD6Frame::CreateD3D: D3D Not Initialized."); + + auto hResult = g_lpD3D->CreateDevice(sDeviceGUID, g_lpRenderBuffer, &g_lpD3Ddevice, nullptr); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_CREATE_3D_DEVICE, hResult); + return 0; + } + + hResult = g_lpD3D->CreateViewport(&g_lpViewport, nullptr); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_CREATE_VIEWPORT, hResult); + return 0; + } + + hResult = g_lpD3Ddevice->AddViewport(g_lpViewport); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_ADD_VIEWPORT, hResult); + return 0; + } + + D3DVIEWPORT2 vdData = {}; + vdData.dwSize = sizeof(vdData); + vdData.dwWidth = g_dwScreenWidth; + vdData.dwHeight = g_dwScreenHeight; + vdData.dvClipX = -1.0; + vdData.dvClipY = -1.0; + vdData.dvClipWidth = 2.0; + vdData.dvClipHeight = 2.0; + vdData.dvMaxZ = 1.0; + + hResult = g_lpViewport->SetViewport2(&vdData); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_SET_VIEWPORT, hResult); + return 0; + } + + hResult = g_lpD3Ddevice->SetCurrentViewport(g_lpViewport); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_SET_CURR_VP, hResult); + return 0; + } + + hResult = g_lpD3D->CreateMaterial(&g_lpBackgroundMaterial, nullptr); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_CREATE_BK_MATERIAL, hResult); + return 0; + } + + D3DMATERIAL sD3DMaterial = {}; + sD3DMaterial.dwSize = sizeof(sD3DMaterial); + sD3DMaterial.dwRampSize = 1; + + hResult = g_lpBackgroundMaterial->SetMaterial(&sD3DMaterial); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_SET_BK_MATERIAL, hResult); + return 0; + } + + hResult = g_lpBackgroundMaterial->GetHandle(g_lpD3Ddevice, &g_hBackgroundMaterial); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_GET_BK_MAT_HANDLE, hResult); + return 0; + } + + return 1; } void cD6Frame::ExamineRenderingCapabilities() { + if (!g_lpDD_ext) + CriticalMsg("cD6Frame::CreateD3D: DirectDraw Not Initialized."); + if (!g_lpRenderBuffer) + CriticalMsg("cD6Frame::CreateD3D: Render surface Not Initialized."); + if (!g_lpD3D) + CriticalMsg("cD6Frame::CreateD3D: D3D Not Initialized."); + if (!g_lpD3Ddevice) + CriticalMsg("cD6Frame::CreateD3D: D3D device Not Initialized."); + + g_sD3DDevDesc = {}; + g_sD3DDevDesc.dwSize = sizeof(g_sD3DDevDesc); + + DevDesc sD3DHELDevDesc = {}; + sD3DHELDevDesc.dwSize = sizeof(sD3DHELDevDesc); + auto hResult = g_lpD3Ddevice->GetCaps(&g_sD3DDevDesc, &sD3DHELDevDesc); + if (hResult) + { + RaiseLGD3DErrorCode(LGD3D_EC_GET_3D_CAPS, hResult); + return; + } + + if ((g_sD3DDevDesc.dwFlags & 2) == 0) + CriticalMsg("Device Description: invalid caps"); + + if ((g_sD3DDevDesc.dwFlags & 0x40) == 0) + CriticalMsg("Device Description: invalid caps"); + + g_bWFog = (g_sD3DDevDesc.dpcTriCaps.dwRasterCaps & 0x100000) != 0; + if ((g_sD3DDevDesc.dpcTriCaps.dwRasterCaps & 0x40000) == 0) + m_dwRequestedFlags &= ~4u; + + m_dwTextureOpCaps = g_sD3DDevDesc.dwTextureOpCaps; + + + unsigned int dwLGMode = 0; + if (m_dwRequestedFlags & 0x100) + { + if (g_sD3DDevDesc.wMaxTextureBlendStages < 2 || g_sD3DDevDesc.wMaxSimultaneousTextures < 2 || LOWORD(g_sD3DDevDesc.dwFVFCaps) < 2) + { + m_dwRequestedFlags &= ~1u; + } + else + { + dwLGMode = 1; + } + } + + pcRenderer = cD6Renderer::Instance(dwLGMode, &m_dwRequestedFlags); } -int c_EnumZBufferFormats(DDPIXELFORMAT *lpDDPixFmt, void *lpContext); +HRESULT CALLBACK c_EnumZBufferFormats(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext) +{ + if (lpDDPixFmt->dwRGBBitCount != 16) + return S_FALSE; + + memcpy(lpContext, lpDDPixFmt, sizeof(DDPIXELFORMAT)); + + return D3D_OK; +} diff --git a/libsrc/lgd3d/d6Intfc.cpp b/libsrc/lgd3d/d6Intfc.cpp index 693b722..cf6414a 100644 --- a/libsrc/lgd3d/d6Intfc.cpp +++ b/libsrc/lgd3d/d6Intfc.cpp @@ -1,8 +1,14 @@ #include -#include #include #include #include +#include + +#include +#include + +bool lgd3d_g_bInitialized = false; + void lgd3d_set_RGB(); void lgd3d_set_hardware(); diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h index 3662784..405c18a 100644 --- a/libsrc/lgd3d/d6Prim.h +++ b/libsrc/lgd3d/d6Prim.h @@ -6,6 +6,8 @@ #include #include +#include + class cD6Primitives { protected: cD6Primitives(const class cD6Primitives &); diff --git a/libsrc/lgd3d/lgSurf.cpp b/libsrc/lgd3d/lgSurf.cpp index 3e2e9d2..1c23e5d 100644 --- a/libsrc/lgd3d/lgSurf.cpp +++ b/libsrc/lgd3d/lgSurf.cpp @@ -1,3 +1,12 @@ #include -BOOL CreateLGSurface(ILGSurface **ppILGSurf); \ No newline at end of file +class cLGSurface : public ILGSurface, public ILGDD4Surface +{ + +}; + +BOOL CreateLGSurface(ILGSurface **ppILGSurf) +{ + *ppILGSurf = new cLGSurface(); + return *ppILGSurf != nullptr; +} \ No newline at end of file diff --git a/libsrc/lgd3d/lgSurf_i.h b/libsrc/lgd3d/lgSurf_i.h index 27f511d..8652528 100644 --- a/libsrc/lgd3d/lgSurf_i.h +++ b/libsrc/lgd3d/lgSurf_i.h @@ -1,74 +1,317 @@ +/* +@Copyright Looking Glass Studios, Inc. +1996,1997,1998,1999,2000 Unpublished Work. +*/ + +/*========================================================= + + Created: 2/23/99 8:58:55 AM + + File: lgSurf.h + + Description: ILGSurface interface + is interface encapsulating video memory + used as a target for 2/3D rendering + +=========================================================*/ + #pragma once -#include -#include -#include -struct sLGSurfaceDescription -{ - DWORD dwWidth; - DWORD dwHeight; - DWORD dwBitDepth; - DWORD dwPitch; - grs_rgb_bitmask sBitmask; -}; +//_____INCLUDES_AND_DEFINITIONS___________________________ -enum eLGSBlit -{ - kLGSBRead = 1, - kLGSBWrite = 2, - kLGSBReadWrite = 3 -}; +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include -enum eLGSurfState -{ - kLGSSUninitialized = 1, - kLGSSInitialized = 2, - kLGSSUnlocked = 3, - kLGSS3DRenderining = 4, - kLGSS2DLocked = 5, - kLGSS2DBlitting = 6 -}; +DEFINE_LG_GUID(IID_ILGSurface, 0x25e); +DEFINE_LG_GUID(IID_ILGDD4Surface, 0x269); -class ILGSurface : public IUnknown +//_______TYPEDEFS_________________________________________ + +// internal states of a LGSurface +typedef enum eLGSurfState{ + kLGSSUninitialized = 0, + kLGSSInitialized, + kLGSSUnlocked, + kLGSS3DRenderining, + kLGSS2DLocked, + kLGSS2DBlitting +} eLGSurfState; + + +// generic surface description for our surface +// NOTE: a pointer to the surface's surface is not included +typedef struct sLGSurfaceDescription { + DWORD dwWidth; + DWORD dwHeight; + DWORD dwBitDepth; + DWORD dwPitch; + grs_rgb_bitmask sBitmask; +} sLGSurfaceDescription; + + +// types of 2d surface lock +typedef enum eLGSBlit{ + kLGSBRead = 0x00000001L, + kLGSBWrite = 0x00000002L, + kLGSBReadWrite = 0x00000004L +} eLGSBlit; + + +//////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ILGSurface + +DECLARE_INTERFACE_(ILGSurface, IUnknown) { -public: - ILGSurface(); - ILGSurface(const ILGSurface &); - virtual ~ILGSurface(); - - // virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); - // virtual ULONG STDMETHODCALLTYPE AddRef(); - // virtual ULONG STDMETHODCALLTYPE Release(); - - virtual int CreateInternalScreenSurface(HWND hMainWindow) = 0; - virtual int ChangeClipper(HWND hMainWindow) = 0; - virtual int SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD *pdwCapabilityFlags, grs_canvas **ppsCanvas) = 0; - virtual int Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD *pdwCapabilityFlags, grs_canvas **ppsCanvas) = 0; - virtual int BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) = 0; - virtual void CleanSurface() = 0; - virtual void Start3D() = 0; - virtual void End3D() = 0; - virtual long LockFor2D(grs_canvas **ppsCanvas, eLGSBlit eBlitFlags) = 0; - virtual long UnlockFor2D() = 0; - virtual DWORD GetWidth() = 0; - virtual DWORD GetHeight() = 0; - virtual DWORD GetPitch() = 0; - virtual DWORD GetBitDepth() = 0; - virtual eLGSurfState GetSurfaceState() = 0; - virtual long GetSurfaceDescription(sLGSurfaceDescription *psDsc) = 0; + DECLARE_UNKNOWN_PURE(); + + + ///////////////////////////// + // + // CreateInternalScreenSurface + // + + // Creates an internal structure that represents the main window + // initial state is required to be kLGSSUninitialized + // state is set to kLGSSInitialized upon the completion + // If hMainWindow is non-NULL, sets the clipper to clip at that window + // if NULL, no clipper is attached + + // E_LGSURF_HARDWARE_ERROR API specific failure + // + STDMETHOD ( CreateInternalScreenSurface ) ( + THIS_ + /*[in]*/ HWND hMainWindow + ) PURE; + + ///////////////////////////// + // + // CreateClipper + // + // Creates or changes the clipper attached to the blit surface + // to a windows handle. If handle is NULL, removes the clipper + + // E_LGSURF_HARDWARE_ERROR API specific failure + // + STDMETHOD ( ChangeClipper ) ( + THIS_ + /*[in]*/ HWND hMainWindow + ) PURE; + + + ///////////////////////////// + // + // SetAs3dHdwTarget + // + + // IF the initial state is kLGSSUninitialized: + // grab the existing hardvare rendering device. At this point global + // rendering target was obtained from the 2d environment + // ELSE + // it is assumed that the internal representation of the screen was allready + // set. + // Upon the completion the state is set to kLGSSUnlocked + + // E_3DHDW_INUSE: the/a renderer could not have been committed + // E_2D_DRIVER_ERROR: failed to obtain data from 2d environment + // E_HARDWARE_ERROR: renderer specific error + // E_OUT_OF_VIDEO_MEMORY: not enough video memory **or** hardware + // incapable of rendering to of-screen surface + STDMETHOD_( HRESULT, SetAs3dHdwTarget ) ( + THIS_ + /*[in]*/ DWORD dwRequestedFlags, + /*[in]*/ DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, + /*[out]*/ DWORD* pdwCapabilityFlags, + /*[out]*/ grs_canvas** ppsCanvas + ) PURE; + + + + + + /////////////////////////////// + // + // Resize3dHdw + // + + // resize the surface and retool the hardware renderer + // (error returns are the same as for "SetAs3dHdwTarget") + STDMETHOD_( HRESULT, Resize3dHdw) ( + THIS_ + /*[in]*/ DWORD dwRequestedFlags, + /*[in]*/ DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, + /*[out]*/ DWORD* pdwCapabilityFlags, + /*[out]*/ grs_canvas** ppsCanvas + ) PURE; + + + ////////////////////////////// + // + // BlitToScreen + // + + // blit the surface to the rendering target determined by the + // 2d environment. The input parameters specify the target rectangle. + // NOTE: the screen coordinate are assumed for dwXScreen and dwYScreen. + // If the rectangle is smaller than the surface upper left rectangle + // of the LGSurface is blitted. Target rectangle larger than the + // surface results in an error. + + // E_SURFACE_LOCKED: surface was not in "unlocked" state + // E_INPUT_PARAMETERS_INVALID: the dimensions passed are too big + // E_HARDWARE_ERROR: blit failed + + STDMETHOD_( HRESULT, BlitToScreen ) (THIS_ + /// target rectangele. All coordintes are relative to the screen + DWORD dwXScreen, + DWORD dwYScreen, + DWORD dwWidth, + DWORD dwHeight + ) + PURE; + + /////////////////////////////// + // + // CleanSurface + // + + // cleans the surface and the depth buffer if it were attached + + STDMETHOD_( void, CleanSurface) (THIS) PURE; + + + /////////////////////////////// + // + // Start3D + // + + // starts a 3d frame, uses the current 3d API to initialize rendering + + STDMETHOD_( void, Start3D) (THIS) PURE; + + + + ////////////////////////////// + // + // End3D + // + + // ends the frame by calling the 3d API's end of frame method + + STDMETHOD_( void, End3D ) (THIS) PURE; + + + ////////////////////////////////// + // + // LockFor2D + // + + // locks the memory of the surface and provides a correct pointer + // to the video memory inside the canvas structure. The pointer should + // be used for writing and/or reading only according to the passed + // flag in eBlitFlags. + + // E_SURFACE_LOCKED: surface is not in the "unlocked" state + // E_HARDWARE_ERROR: API specific failure to lock the surface + + STDMETHOD_( HRESULT, LockFor2D ) ( + THIS_ + /*[out]*/ grs_canvas** ppsCanvas, + /*[in]*/ eLGSBlit eBlitFlags + ) PURE; + + + + ///////////////////////////// + // + // UnlockFor2D + // + + // unlocks the videomemory. + // NOTE: the memory pointer in the canvas structure is set to NULL + + // E_SURFACE_WASNOT_LOCKED: surface was not locked for 2d rendering + // E_HARDWARE_ERROR: API specific failure to unlock the surface + + STDMETHOD_( HRESULT, UnlockFor2D ) (THIS) PURE; + + + + // State queries + + STDMETHOD_( DWORD, GetWidth ) (THIS) PURE; + STDMETHOD_( DWORD, GetHeight ) (THIS) PURE; + STDMETHOD_( DWORD, GetPitch ) (THIS) PURE; + STDMETHOD_( DWORD, GetBitDepth ) (THIS) PURE; + STDMETHOD_( eLGSurfState, GetSurfaceState ) (THIS) PURE; + + ///////////////////////// + // + // GetSurfaceDescription + // + + // copies sLGSurfaceDescription into the provided structure, *psDsc + + // E_INPUT_PARAMETERS_INVALID: psDsc is NULL + + STDMETHOD_( HRESULT, GetSurfaceDescription) (THIS_ + /*[out]*/ sLGSurfaceDescription* psDsc ) PURE; }; -class ILGDD4Surface : public IUnknown +#undef INTERFACE +#define INTERFACE ILGDD4Surface + +DECLARE_INTERFACE_(ILGDD4Surface, IUnknown) { -public: - ILGDD4Surface(); - ILGDD4Surface(const ILGDD4Surface &); - virtual ~ILGDD4Surface(); - - int GetDeviceInfoIndex(); - int GetDirectDraw(IDirectDraw4 **ppDD); - int GetRenderSurface(IDirectDrawSurface4 **ppRS); + DECLARE_UNKNOWN_PURE(); + + STDMETHOD_( int, GetDeviceInfoIndex ) (THIS); + + STDMETHOD_( int, GetDirectDraw ) ( + THIS_ + /*[out]*/ IDirectDraw4 **ppDD + ); + + STDMETHOD_( int, GetRenderSurface ) ( + THIS_ + /*[out]*/ IDirectDrawSurface4 **ppRS + ); }; -BOOL CreateLGSurface(ILGSurface **ppILGSurf); \ No newline at end of file + +//______EXPORTED_DATA_____________________________________ + + +/// creates an empty surface +EXTERN BOOL CreateLGSurface( ILGSurface** ppILGSurf ); + + + +//______ERROR_MESSAGES_____________________________________ + + +#define LGSURF_SUBSYS 4 + + +#define E_LGSURF_ALREADY_INITIALIZED MakeResult( kError, LGSURF_SUBSYS, 1 ) + +#define E_LGSURF_3DHDW_INUSE MakeResult( kError, LGSURF_SUBSYS, 2 ) + +#define S_LGSURF_3DHDW_ATTACHED MakeResult( kSuccess, LGSURF_SUBSYS, 3 ) + +#define E_LGSURF_2D_DRIVER_ERROR MakeResult( kError, LGSURF_SUBSYS, 4 ) + +#define E_LGSURF_HARDWARE_ERROR MakeResult( kError, LGSURF_SUBSYS, 5 ) + +#define E_LGSURF_OUT_OF_VIDEO_MEMORY MakeResult( kError, LGSURF_SUBSYS, 6 ) + +#define E_LGSURF_SURFACE_LOCKED MakeResult( kError, LGSURF_SUBSYS, 7 ) + +#define E_LGSURF_SURFACE_WASNOT_LOCKED MakeResult( kError, LGSURF_SUBSYS, 8 ) + +#define E_LGSURF_INPUT_PARAMETERS_INVALID MakeResult( kError, LGSURF_SUBSYS, 9 ) diff --git a/libsrc/lgd3d/texmgr.cpp b/libsrc/lgd3d/texmgr.cpp index b6b0532..5b245b9 100644 --- a/libsrc/lgd3d/texmgr.cpp +++ b/libsrc/lgd3d/texmgr.cpp @@ -31,5 +31,5 @@ lgd3ds_device_info *lgd3d_get_device_info(int device_number); int __stdcall c_DDEnumCallback(_GUID *lpGUID, char *lpDriverDescription, char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); void GetDevices(LGD3D_sEnumerationInfo *info); int __stdcall c_EnumDisplayModesCallback(_DDSURFACEDESC2 *pSD, char *data); -int __stdcall c_EnumDevicesCallback(_GUID *lpGuid, char *lpDeviceDescription, char *lpDeviceName, _D3DDeviceDesc *pDeviceDesc, _D3DDeviceDesc *lpD3DHELDeviceDesc, void *lpUserArg); +int __stdcall c_EnumDevicesCallback(_GUID *lpGuid, char *lpDeviceDescription, char *lpDeviceName, DevDesc *pDeviceDesc, DevDesc *lpD3DHELDeviceDesc, void *lpUserArg); int (__stdcall *__thiscall __cDynFunc__DirectDrawEnumerateA::GetProcAddress(__cDynFunc__DirectDrawEnumerateA *this))(int (__stdcall *)(_GUID *, char *, char *, void *), void *); From b21a52a6136123ae7146fd2bf96becff91860df3 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 27 Jun 2024 23:42:42 +0300 Subject: [PATCH 15/35] lgd3d fixes #2 --- libsrc/lgd3d/d6Enum.cpp | 26 ++++++++++++++------------ libsrc/lgd3d/texmgr.cpp | 22 ++++++++++++---------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp index 01fecc7..9388c9d 100644 --- a/libsrc/lgd3d/d6Enum.cpp +++ b/libsrc/lgd3d/d6Enum.cpp @@ -9,10 +9,12 @@ #include #include #include +#include static bool bWBuffer; static int nNoDevices = -2; -static lgd3ds_device_info* psDeviceList[10]; +#define MAX_DEVICE_NUMBER 10 +static lgd3ds_device_info* psDeviceList[MAX_DEVICE_NUMBER]; static bool bNoD3d = true; static bool bDepthBuffer = false; static bool bWindowed = false; @@ -196,38 +198,38 @@ HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, return 1; } - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) { - pDeviceDesc->dpcTriCaps.dwRasterCaps &= 0xFE; + pDeviceDesc->dpcTriCaps.dwRasterCaps &= ~D3DPRASTERCAPS_DITHER; } - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) { capabilities_flags = 0x80000; } - else if (info->requested_flags & 0x10) + else if (info->requested_flags & LGD3DF_TABLE_FOG) { mprintf("no table fog\n"); return 1; } - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) { capabilities_flags |= 0x100000u; } - else if (info->requested_flags & 0x20) + else if (info->requested_flags & LGD3DF_VERTEX_FOG) { mprintf("no vertex fog\n"); return 1; } - if ((pDeviceDesc->dpcTriCaps.dwShadeCaps & D3DPRASTERCAPS_ZBIAS) != 0) + if (pDeviceDesc->dpcTriCaps.dwShadeCaps & D3DPRASTERCAPS_ZBIAS) capabilities_flags |= 0x8000000u; if (bDepthBuffer) { capabilities_flags |= 0x10000u; - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) capabilities_flags |= 0x40000u; } @@ -237,13 +239,13 @@ HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, if (pDeviceDesc->wMaxTextureBlendStages >= 2 && pDeviceDesc->wMaxSimultaneousTextures >= 2 && pDeviceDesc->dwFVFCaps >= 2) capabilities_flags |= 0x2000000u; - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) capabilities_flags |= 0x200000u; - if ((pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) != 0) + if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) capabilities_flags |= 0x400000u; - if (info->device_number >= 10) + if (info->device_number >= MAX_DEVICE_NUMBER) CriticalMsg("Too many d3d devices available."); lgd3ds_device_info* device_info; diff --git a/libsrc/lgd3d/texmgr.cpp b/libsrc/lgd3d/texmgr.cpp index 5b245b9..ba64aaa 100644 --- a/libsrc/lgd3d/texmgr.cpp +++ b/libsrc/lgd3d/texmgr.cpp @@ -1,8 +1,9 @@ +#include #include texture_manager *get_dopey_texture_manager(cD6States *driver); -unsigned __int8 *tmgr_set_clut(unsigned __int8 *clut); +uint8 *tmgr_set_clut(uint8 *clut); unsigned int tmgr_bytes_loaded(); int tmgr_get_utilization(float *utilization); void tmgr_restore_bits(grs_bitmap *bm); @@ -24,12 +25,13 @@ tmgr_texture_info *init_bitmap_list(); void tmgr_shutdown(); int tmgr_stats(); -int lgd3d_enumerate_devices(); -int lgd3d_enumerate_devices_capable_of(unsigned int flags); -void lgd3d_unenumerate_devices(); -lgd3ds_device_info *lgd3d_get_device_info(int device_number); -int __stdcall c_DDEnumCallback(_GUID *lpGUID, char *lpDriverDescription, char *lpDriverName, LGD3D_sEnumerationInfo *lpContext); -void GetDevices(LGD3D_sEnumerationInfo *info); -int __stdcall c_EnumDisplayModesCallback(_DDSURFACEDESC2 *pSD, char *data); -int __stdcall c_EnumDevicesCallback(_GUID *lpGuid, char *lpDeviceDescription, char *lpDeviceName, DevDesc *pDeviceDesc, DevDesc *lpD3DHELDeviceDesc, void *lpUserArg); -int (__stdcall *__thiscall __cDynFunc__DirectDrawEnumerateA::GetProcAddress(__cDynFunc__DirectDrawEnumerateA *this))(int (__stdcall *)(_GUID *, char *, char *, void *), void *); +int lgd3d_enumerate_devices(); +int lgd3d_enumerate_devices_capable_of(unsigned int flags); +void lgd3d_unenumerate_devices(); +lgd3ds_device_info *lgd3d_get_device_info(int device_number); + +void GetDevices(LGD3D_sEnumerationInfo *info); + +BOOL CALLBACK c_DDEnumCallback(GUID* lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext); +HRESULT CALLBACK c_EnumDisplayModesCallback(LPDDSURFACEDESC2 pSD, LPVOID data); +HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC pDeviceDesc, LPD3DDEVICEDESC lpD3DHELDeviceDesc, LPVOID lpUserArg); From 7ee9ab3338854ce5a35468deae12023f7425cd24 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 27 Jun 2024 23:58:36 +0300 Subject: [PATCH 16/35] texmgr: remove unused declarations --- libsrc/lgd3d/texmgr.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/libsrc/lgd3d/texmgr.cpp b/libsrc/lgd3d/texmgr.cpp index ba64aaa..7f97149 100644 --- a/libsrc/lgd3d/texmgr.cpp +++ b/libsrc/lgd3d/texmgr.cpp @@ -24,14 +24,3 @@ int tmgr_init(grs_bitmap *bm, int num_textures, int *size_list, int num_sizes); tmgr_texture_info *init_bitmap_list(); void tmgr_shutdown(); int tmgr_stats(); - -int lgd3d_enumerate_devices(); -int lgd3d_enumerate_devices_capable_of(unsigned int flags); -void lgd3d_unenumerate_devices(); -lgd3ds_device_info *lgd3d_get_device_info(int device_number); - -void GetDevices(LGD3D_sEnumerationInfo *info); - -BOOL CALLBACK c_DDEnumCallback(GUID* lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext); -HRESULT CALLBACK c_EnumDisplayModesCallback(LPDDSURFACEDESC2 pSD, LPVOID data); -HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC pDeviceDesc, LPD3DDEVICEDESC lpD3DHELDeviceDesc, LPVOID lpUserArg); From 26eace17854cb0c0f2db06a08601b084e95e854f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 3 Jul 2024 02:09:19 +0300 Subject: [PATCH 17/35] lgd3d: compilation fixes --- libsrc/dev2d/bitmap.h | 1 + libsrc/lgd3d/d6Enum.cpp | 13 +- libsrc/lgd3d/d6Frame.cpp | 6 +- libsrc/lgd3d/d6Intfc.cpp | 123 ++------ libsrc/lgd3d/d6Prim.h | 6 +- libsrc/lgd3d/d6Render.h | 4 +- libsrc/lgd3d/d6States.h | 109 ------- libsrc/lgd3d/d6sts_s.cpp | 36 ++- libsrc/lgd3d/lgSS2P.h | 14 + libsrc/lgd3d/lgd3d.h | 441 +++++++++++++++++++++++++++++ libsrc/lgd3d/lgd3d.vcxproj | 3 + libsrc/lgd3d/lgd3d.vcxproj.filters | 38 +-- libsrc/lgd3d/texmgr.cpp | 1 + libsrc/lgd3d/tmgr.h | 69 +++++ libsrc/r3d/primd3d.c | 28 +- 15 files changed, 629 insertions(+), 263 deletions(-) create mode 100644 libsrc/lgd3d/lgSS2P.h create mode 100644 libsrc/lgd3d/lgd3d.h create mode 100644 libsrc/lgd3d/tmgr.h diff --git a/libsrc/dev2d/bitmap.h b/libsrc/dev2d/bitmap.h index 572d9b4..cef03b8 100644 --- a/libsrc/dev2d/bitmap.h +++ b/libsrc/dev2d/bitmap.h @@ -24,6 +24,7 @@ enum { BMT_BANK16, BMT_BANK24, BMT_TLUC8, + BMT_FLAT32, BMT_TYPES }; /* diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp index 9388c9d..8cdf376 100644 --- a/libsrc/lgd3d/d6Enum.cpp +++ b/libsrc/lgd3d/d6Enum.cpp @@ -1,7 +1,8 @@ -#include -#include -#include + #include +#include +#include +#include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include static bool bWBuffer; static int nNoDevices = -2; @@ -29,6 +31,11 @@ struct LGD3D_sEnumerationInfo DWORD requested_flags; }; + +BOOL CALLBACK c_DDEnumCallback(GUID* lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext); +HRESULT CALLBACK c_EnumDisplayModesCallback(LPDDSURFACEDESC2 pSD, LPVOID data); +HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC pDeviceDesc, LPD3DDEVICEDESC lpD3DHELDeviceDesc, LPVOID lpUserArg); + int lgd3d_enumerate_devices() { return lgd3d_enumerate_devices_capable_of(0); diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp index dbce88c..0015c43 100644 --- a/libsrc/lgd3d/d6Frame.cpp +++ b/libsrc/lgd3d/d6Frame.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -15,8 +16,8 @@ IDirectDrawSurface4* g_lpRenderBuffer = nullptr; IDirectDrawSurface4* g_lpDepthBuffer = nullptr; IDirect3DDevice3* g_lpD3Ddevice = nullptr; -extern bool lgd3d_g_bInitialized; -bool bSpewOn; +extern BOOL lgd3d_g_bInitialized; +BOOL bSpewOn; int g_bWFog; DWORD g_dwScreenWidth; @@ -40,6 +41,7 @@ IDirect3DViewport3* g_lpViewport; IDirect3DMaterial3* g_lpBackgroundMaterial; int g_b8888supported; +HRESULT CALLBACK c_EnumZBufferFormats(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext); static inline void RaiseLGD3DErrorCode(DWORD dwCode, DWORD hResult) { diff --git a/libsrc/lgd3d/d6Intfc.cpp b/libsrc/lgd3d/d6Intfc.cpp index cf6414a..d5262fb 100644 --- a/libsrc/lgd3d/d6Intfc.cpp +++ b/libsrc/lgd3d/d6Intfc.cpp @@ -3,128 +3,41 @@ #include #include #include +#include #include #include +#include -bool lgd3d_g_bInitialized = false; +BOOL lgd3d_g_bInitialized = false; -void lgd3d_set_RGB(); -void lgd3d_set_hardware(); -void lgd3d_set_software(); -int lgd3d_is_RGB(); -int lgd3d_is_hardware(); -void lgd3d_texture_set_RGB(uint8 is_RGB); -int lgd3d_init(lgd3ds_device_info *device_info); -int lgd3d_attach_to_lgsurface(ILGSurface *pILGSurface); -void lgd3d_clean_render_surface(int bDepthBuffToo); -void lgd3d_shutdown(); -int lgd3d_set_poly_mode(ePolyMode eNewMode); -ePolyMode lgd3d_get_poly_mode(); -void lgd3d_start_frame(int frame); -void lgd3d_end_frame(); -int lgd3d_overlays_master_switch(int bOverlaysOn); -int lgd3d_release_indexed_primitives(); int lgd3d_rgb_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); int lgd3d_rgba_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); -int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); -int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); +//int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); +//int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); int lgd3d_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); -int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); -void lgd3d_tmap_setup(grs_bitmap *bm); -void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); +//int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); +//void lgd3d_tmap_setup(grs_bitmap *bm); +//void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); int lgd3d_rgblit_trifan(int n, r3s_point **ppl); int lgd3d_rgblit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); +//void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); int lgd3d_rgbalit_trifan(int n, r3s_point **ppl); int lgd3d_rgbalit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); +//void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); int lgd3d_rgbafoglit_trifan(int n, r3s_point **ppl); int lgd3d_rgbafoglit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); +//void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); int lgd3d_diffspecular_trifan(int n, r3s_point **ppl); int lgd3d_diffspecular_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -void lgd3d_lit_tmap_setup(grs_bitmap *bm); -void lgd3d_poly_setup(); -void lgd3d_spoly_setup(); -void lgd3d_rgb_poly_setup(); + +//void lgd3d_lit_tmap_setup(grs_bitmap *bm); +//void lgd3d_poly_setup(); +//void lgd3d_spoly_setup(); +//void lgd3d_rgb_poly_setup(); int lgd3d_rgb_poly(int n, r3s_point **ppl); -void lgd3d_rgba_poly_setup(); +//void lgd3d_rgba_poly_setup(); int lgd3d_rgba_poly(int n, r3s_point **ppl); -int lgd3d_draw_point(r3s_point *p); -void lgd3d_set_zwrite(int zwrite); -void lgd3d_set_zcompare(int zwrite); -void lgd3d_zclear(); -void lgd3d_set_znearfar(long double znear, long double zfar); + void setwbnf(IDirect3DDevice3 *lpDev, long double dvWNear, long double dvWFar); -void lgd3d_get_znearfar(long double *pdZNear, long double *pdZFar); -void lgd3d_set_pal(int start, int n, uint8 *pal_data); -void lgd3d_set_pal_slot(int start, int n, uint8 *pal_data, int slot); -void lgd3d_set_pal_slot_flags(int start, int n, uint8 *pal_data, int slot, char flags); -void lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask *bitmask); -void lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask *bitmask); -void lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask *bitmask); -void lgd3d_set_texture_clut(uint8 *clut); -uint8 *lgd3d_set_clut(uint8 *clut); -void lgd3d_set_fog_level(float fog_level); -void lgd3d_set_fog_color(int r, int g, int b); -void lgd3d_set_fog_enable(int enable); -void lgd3d_set_fog_density(float density); -int lgd3d_use_linear_table_fog(int bUseIt); -void lgd3d_set_fog_start_end(float fStart, float fEnd); -void lgd3d_set_linear_fog_distance(float fDistance); -void lgd3d_set_alpha(float alpha); -void lgd3d_set_blend(int do_blend); -void lgd3d_blend_multiply(int blend_mode); -void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1); -void lgd3d_blend_normal(); -void lgd3d_set_offsets(int x, int y); -void lgd3d_get_offsets(int *x, int *y); -void lgd3d_set_z(float z); -void lgd3d_disable_palette(); -void lgd3d_enable_palette(); -void lgd3d_hack_light(r3s_point *p, float r); -void lgd3d_hack_light_extra(r3s_point *p, float r, grs_bitmap *bm); -void lgd3d_draw_line(r3s_point *p0, r3s_point *p1); -int lgd3d_trifan(int n, r3s_point **vpl); -int lgd3d_lit_trifan(int n, r3s_point **vpl); -int lgd3d_poly(int n, r3s_point **vpl); -int lgd3d_spoly(int n, r3s_point **vpl); -int lgd3d_g2upoly(int n, g2s_point **vpl); -int lgd3d_g2poly(int n, g2s_point **vpl); -int lgd3d_g2utrifan(int n, g2s_point **vpl); -int lgd3d_g2trifan(int n, g2s_point **vpl); -void lgd3d_set_light_map_method(unsigned int flag); -int lgd3d_TrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_LitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_RGBlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_RGBAlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_RGBAFoglitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_DiffuseSpecularMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc); -int lgd3d_g2UTrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **vptc); -int lgd3d_g2TrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **vptc); -void lgd3d_set_texture_level(int n); -double lgd3d_set_zbias(long double new_bias); -void lgd3d_push_zbias_i(unsigned int nZBias); -void lgd3d_pop_zbias(); -void lgd3d_set_chromakey(int red, int green, int blue); -void lgd3d_set_alpha_pal(unsigned __int16 *pal); -void lgd3d_blit(); -void lgd3d_clear(int color_index); -D3DZBUFFERTYPE lgd3d_get_depth_buffer_state(); -int lgd3d_is_zwrite_on(); -int lgd3d_is_zcompare_on(); -int lgd3d_is_alpha_blending_on(); -int lgd3d_set_shading(int bSmoothShading); -int lgd3d_is_smooth_shading_on(); -int lgd3d_is_fog_on(); -void lgd3d_set_texture_map_method(unsigned int flag); -void lgd3d_get_texblending_modes(unsigned int *pulLevel0Mode, unsigned int *pulLevel1Mode); -void lgd3d_set_dithering(int bOn); -int lgd3d_is_dithering_on(); -void lgd3d_set_antialiasing(int bOn); -int lgd3d_is_antialiasing_on(); -int lgd3d_enable_specular(int bUseIt); -int lgd3d_get_texture_wrapping(unsigned int dwLevel); -int lgd3d_set_texture_wrapping(unsigned int dwLevel, int bSetSmooth); \ No newline at end of file diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h index 405c18a..ff91c92 100644 --- a/libsrc/lgd3d/d6Prim.h +++ b/libsrc/lgd3d/d6Prim.h @@ -2,12 +2,10 @@ #include -#include +#include #include #include -#include - class cD6Primitives { protected: cD6Primitives(const class cD6Primitives &); @@ -15,7 +13,7 @@ class cD6Primitives { ~cD6Primitives(); public: - cD6Primitives * DeInstance(); + virtual cD6Primitives * DeInstance(); private: int m_bPrimitivesPending; diff --git a/libsrc/lgd3d/d6Render.h b/libsrc/lgd3d/d6Render.h index 46a2901..87e8e98 100644 --- a/libsrc/lgd3d/d6Render.h +++ b/libsrc/lgd3d/d6Render.h @@ -11,8 +11,8 @@ class cD6Renderer { ~cD6Renderer(); public: - cD6Renderer* Instance(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags); - cD6Renderer* DeInstance(); + static cD6Renderer* Instance(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags); + static cD6Renderer* DeInstance(); private: void CreateStatesStack(DWORD dwInitialSize, DWORD dwEntrySize); diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index 9cb77b0..d763687 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -1,7 +1,5 @@ #pragma once -#include - #include #include #include @@ -220,113 +218,6 @@ extern IDirect3DDevice3* g_lpD3Ddevice; extern IDirectDraw4* g_lpDD_ext; extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; -/* code from lgd3d.h */ - -#define LGRT_SINGLE_TEXTURE_SINGLE_PASS 0L -#define LGRT_MULTI_TEXTURE_SINGLE_PASS 1L - - //NOTE: multipass multitexturing is not supported!!! - - // Capabilities that can be requested: - -#define LGD3DF_SPEW 0x00000002L - -//depth buffer: -#define LGD3DF_ZBUFFER 0x00000001L // Z-buffer -#define LGD3DF_WBUFFER 0x00000004L // W-buffer -#define LGD3DF_DEPTH_BUFFER_REQUIRED 0x00000008L // the -// selected (Z_ or W-) depth buffer REQUIRED! -//fog: -#define LGD3DF_TABLE_FOG 0x00000010L // table based pixel fog -#define LGD3DF_VERTEX_FOG 0x00000020L - -//dithering -#define LGD3DF_DITHER 0x00000040L // use dithering - -//antialiasing -#define LGD3DF_ANTIALIAS 0x00000080L // use (sort independent) antialiasing - -#define LGD3DF_MULTI_TEXTURING 0x00000100L // we support ONLY two sets of textures and -// and texture coordinates - -#define LGD3DF_MODULATEALPHA 0x00000200L // we want to use modulate alpha for single texture mode -#define LGD3DF_BLENDDIFFUSE 0x00000400L // we want to use blend diffuse for single texture mode - -#define LGD3DF_MULTITEXTURE_COLOR 0x00000800L // we want to use color light maps for single or multi texture mode -#define LGD3DF_MULTITEXTURE_ALPHA 0x00001000L // we want to use alpha light maps for single or multi texture mode - -#define LGD3DF_DO_WINDOWED 0x00002000L - -#define LGD3DF_MT_BLENDDIFFUSE 0x00004000L // we want to use alpha light maps for single or multi texture mode - -// Supported capabilities: (returned by the enumeration) - -//depth buffer -#define LGD3DF_CAN_DO_ZBUFFER 0x00010000L -#define LGD3DF_CAN_DO_WBUFFER 0x00040000L // W-buffer -//fog: -#define LGD3DF_CAN_DO_TABLE_FOG 0x00080000L // table based pixel fog -#define LGD3DF_CAN_DO_VERTEX_FOG 0x00100000L // vertex fog -//dithering -#define LGD3DF_CAN_DO_DITHER 0x00200000L // can dither -#define LGD3DF_CAN_DO_ANTIALIAS 0x00400000L // can use (sort independent) antialiasing - -#define LGD3DF_CAN_DO_SINGLE_PASS_MT 0x02000000L // we can do single pass double texturing -#define LGD3DF_CAN_DO_WINDOWED 0x04000000L // we can play the game in lil' window - -#define LGD3DF_CAN_DO_ITERATE_ALPHA 0x08000000L // can do Gouraud interpolation between vetices alpha color - - -/////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////// - - // Multi texturing - - //used for single level texturing -#define LGD3DTB_MODULATE 0L //default -#define LGD3DTB_MODULATEALPHA 1L -#define LGD3DTB_BLENDDIFFUSE 2L - -#define LGD3DTB_NO_STATES 3L - - //2 levels texturing: -#define LGD3D_MULTITEXTURE_COLOR 0L //default -#define LGD3D_MULTITEXTURE_ALPHA 1L -#define LGD3D_MULTITEXTURE_BLEND_TEX_ALPHA 2L - -#define LGD3D_MULTITEXTURE_NO_STATES 3L - - // additional sets of texture coordinates are added - typedef struct { - float u, v; - } LGD3D_tex_coord; - - // error codes:( the first argument of "lgd3d_get_error" ) -#define LGD3D_EC_OK 0L -#define LGD3D_EC_DD_KAPUT 1L -#define LGD3D_EC_RESTORE_ALL_SURFS 2L -#define LGD3D_EC_QUERY_D3D 3L -#define LGD3D_EC_GET_DD_CAPS 4L -#define LGD3D_EC_ZBUFF_ENUMERATION 5L -#define LGD3D_EC_CREATE_3D_DEVICE 6L -#define LGD3D_EC_CREATE_VIEWPORT 7L -#define LGD3D_EC_ADD_VIEWPORT 8L -#define LGD3D_EC_SET_VIEWPORT 9L -#define LGD3D_EC_SET_CURR_VP 10L -#define LGD3D_EC_CREATE_BK_MATERIAL 11L -#define LGD3D_EC_SET_BK_MATERIAL 12L -#define LGD3D_EC_GET_BK_MAT_HANDLE 13L -#define LGD3D_EC_GET_SURF_DESC 14L -#define LGD3D_EC_GET_3D_CAPS 15L -#define LGD3D_EC_VD_MPASS_MT 16L -#define LGD3D_EC_VD_S_DEFAULT 17L -#define LGD3D_EC_VD_SPASS_MT 18L -#define LGD3D_EC_VD_M_DEFAULT 19L -#define LGD3D_EC_VD_SPASS_BLENDDIFFUSE 20L -#define LGD3D_EC_VD_MPASS_BLENDDIFFUSE 21L - -BOOL lgd3d_get_error(DWORD* pdwCode, DWORD* phResult); extern int bSpewOn; extern char* GetDDErrorMsg(int hRes); extern int g_bPrefer_RGB; diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index af8186c..4b4090a 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -1,11 +1,15 @@ -#include +#include #include + +#include +#include + #include #include -#include #include + BOOL lgd3d_blend_trans = TRUE; #ifndef SHIP @@ -18,9 +22,12 @@ BOOL lgd3d_blend_trans = TRUE; // #include "d3dmacs.h" #include "d6States.h" +#include +#include #include #include +#include #ifndef SHIP @@ -32,6 +39,9 @@ static char* pcLGD3Def = (char*)"LGD3D error no %d : %s : message: %d\n%s"; #define CheckHResult(hRes, msg) \ AssertMsg3(hRes==0, hResErrorMsg, msg, (hRes>>16)&0x7fff, hRes&0xffff) +extern cD6Primitives* pcRenderBuffer; +extern cD6Renderer* pcRenderer; + class cImStates : public cD6States { public: @@ -72,11 +82,12 @@ class cMSStates : public cD6States { virtual void SetLightMapMode(DWORD dwFlag) override; virtual void SetTextureLevel(int n) override; virtual int EnableMTMode(DWORD dwMTOn) override; - virtual void TurnOffTexuring(bool bTexOff) override; + virtual void TurnOffTexuring(BOOL bTexOff) override; }; DDPIXELFORMAT* g_FormatList[5]; +#define LGD3D_MAX_TEXTURES 1024 sTextureData g_saTextures[LGD3D_MAX_TEXTURES]; DDPIXELFORMAT g_RGBTextureFormat; @@ -143,7 +154,7 @@ void blit_16to16_scale(tdrv_texture_info *info, uint16 *dst, int drow); void blit_32to32(tdrv_texture_info *info, uint16 *dst, int drow); void blit_32to32_scale(tdrv_texture_info *info, uint16 *dst, int drow); void blit_32to16(tdrv_texture_info *info, uint16 *dst, unsigned int drow); -int EnumTextureFormatsCallback(_DDPIXELFORMAT *lpDDPixFmt, void *lpContext); +int STDMETHODCALLTYPE EnumTextureFormatsCallback(DDPIXELFORMAT* lpDDPixFmt, void* lpContext); void CheckSurfaces(sWinDispDevCallbackInfo *info); void InitDefaultTexture(int size); int FindClosestColor(float r, float g, float b); @@ -354,7 +365,7 @@ int init_size_tables(int** p_size_list) init_size_table(rgb_size_table, TF_ALPHA); init_size_table(trgb_size_table, TF_ALPHA | TF_RGB); init_size_table(b8888_size_table, TF_TRANS); - munge_size_tables(p_size_list); + return munge_size_tables(p_size_list); } void InitDefaultTexture(int size) @@ -418,13 +429,12 @@ int cD6States::Initialize(ulong dwRequestedFlags) pWinDisplayDevice = AppGetObj(IWinDisplayDevice); pWinDisplayDevice->AddTaskSwitchCallback(CheckSurfaces); - if (pWinDisplayDevice) - pWinDisplayDevice->Release(); + SafeRelease(pWinDisplayDevice); InitDefaultTexture(16); InitTextureManager(); - SetDefaultsStates(dwRequestedFlags); + return SetDefaultsStates(dwRequestedFlags); } #define NONLOCAL_CAPS DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM | DDSCAPS_ALLOCONLOAD @@ -907,8 +917,8 @@ void cD6States::release_texture(int n) } } - RELEASE(psTexData->lpTexture); - RELEASE(psTexData->lpSurface); + SafeRelease(psTexData->lpTexture); + SafeRelease(psTexData->lpSurface); psTexData->pTdrvBitmap = 0; } @@ -931,7 +941,7 @@ int cD6States::reload_texture(tdrv_texture_info* info) pixel_format = g_FormatList[2]; if (pixel_format->dwFlags == 0) - return TDRV_FAILURE; + return TMGR_FAILURE; memset(&pddsd, 0, sizeof(pddsd)); pddsd.dwSize = sizeof(pddsd); @@ -971,7 +981,7 @@ int cD6States::reload_texture(tdrv_texture_info* info) SafeRelease(SysmemTexture); SafeRelease(SysmemSurface); *pDeviceSurface = NULL; - return TDRV_FAILURE; + return TMGR_FAILURE; } DeviceSurface = *pDeviceSurface; @@ -1014,7 +1024,7 @@ int cD6States::reload_texture(tdrv_texture_info* info) g_saTextures[info->id].pTdrvBitmap = info->bm; g_saTextures[info->id].TdrvCookie.value = info->cookie; - return TDRV_SUCCESS; + return TMGR_SUCCESS; } diff --git a/libsrc/lgd3d/lgSS2P.h b/libsrc/lgd3d/lgSS2P.h new file mode 100644 index 0000000..f26b7e9 --- /dev/null +++ b/libsrc/lgd3d/lgSS2P.h @@ -0,0 +1,14 @@ +/* +@Copyright Looking Glass Studios, Inc. +1996,1997,1998,1999,2000 Unpublished Work. +*/ + +//# $Header: x:/prj/tech/libsrc/lgd3d/RCS/lgss2p.h 1.1 1999/10/21 16:56:48 MAT Exp $ + +#ifndef _LGSS2P_H +#define _LGSS2P_H + +EXTERN BOOL b_SS2_UseSageTexManager; + + +#endif //_LGSS2P_H diff --git a/libsrc/lgd3d/lgd3d.h b/libsrc/lgd3d/lgd3d.h new file mode 100644 index 0000000..56c69e4 --- /dev/null +++ b/libsrc/lgd3d/lgd3d.h @@ -0,0 +1,441 @@ +/* +@Copyright Looking Glass Studios, Inc. +1996,1997,1998,1999,2000 Unpublished Work. +*/ + +// $Header: x:/prj/tech/libsrc/lgd3d/RCS/lgd3d.h 1.59 1970/01/01 00:00:00 Zarko Exp $ + +#ifndef __LGD3D_H +#define __LGD3D_H + + +#include +#include + +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ILGSurface ILGSurface; + +typedef struct _D3DDeviceDesc DevDesc; + +typedef struct lgd3ds_device_info { + GUID device_guid; + GUID* p_ddraw_guid; + DevDesc* device_desc; + short* supported_modes; // -1 terminated list + char* p_ddraw_desc; + ulong flags; +} lgd3ds_device_info; + + +extern int lgd3d_enumerate_devices(void); +extern lgd3ds_device_info *lgd3d_get_device_info(int device); + + +//////////////NEW in a 50% bigger packaging!!!//////////////////////////// + +/// lgd3ds_device_info flags passed to the libray +/// or returned by the enumeration. + +extern int lgd3d_enumerate_devices_capable_of( ulong flags ); + +#define LGRT_SINGLE_TEXTURE_SINGLE_PASS 0L +#define LGRT_MULTI_TEXTURE_SINGLE_PASS 1L + +//NOTE: multipass multitexturing is not supported!!! + +// Capabilities that can be requested: + +#define LGD3DF_SPEW 0x00000002L + +//depth buffer: +#define LGD3DF_ZBUFFER 0x00000001L // Z-buffer +#define LGD3DF_WBUFFER 0x00000004L // W-buffer +#define LGD3DF_DEPTH_BUFFER_REQUIRED 0x00000008L // the +// selected (Z_ or W-) depth buffer REQUIRED! +//fog: +#define LGD3DF_TABLE_FOG 0x00000010L // table based pixel fog +#define LGD3DF_VERTEX_FOG 0x00000020L + +//dithering +#define LGD3DF_DITHER 0x00000040L // use dithering + +//antialiasing +#define LGD3DF_ANTIALIAS 0x00000080L // use (sort independent) antialiasing + +#define LGD3DF_MULTI_TEXTURING 0x00000100L // we support ONLY two sets of textures and +// and texture coordinates + +#define LGD3DF_MODULATEALPHA 0x00000200L // we want to use modulate alpha for single texture mode +#define LGD3DF_BLENDDIFFUSE 0x00000400L // we want to use blend diffuse for single texture mode + +#define LGD3DF_MULTITEXTURE_COLOR 0x00000800L // we want to use color light maps for single or multi texture mode +#define LGD3DF_MULTITEXTURE_ALPHA 0x00001000L // we want to use alpha light maps for single or multi texture mode + +#define LGD3DF_DO_WINDOWED 0x00002000L + +#define LGD3DF_MT_BLENDDIFFUSE 0x00004000L // we want to use alpha light maps for single or multi texture mode + +// Supported capabilities: (returned by the enumeration) + +//depth buffer +#define LGD3DF_CAN_DO_ZBUFFER 0x00010000L +#define LGD3DF_CAN_DO_WBUFFER 0x00040000L // W-buffer +//fog: +#define LGD3DF_CAN_DO_TABLE_FOG 0x00080000L // table based pixel fog +#define LGD3DF_CAN_DO_VERTEX_FOG 0x00100000L // vertex fog +//dithering +#define LGD3DF_CAN_DO_DITHER 0x00200000L // can dither +#define LGD3DF_CAN_DO_ANTIALIAS 0x00400000L // can use (sort independent) antialiasing + +#define LGD3DF_CAN_DO_SINGLE_PASS_MT 0x02000000L // we can do single pass double texturing +#define LGD3DF_CAN_DO_WINDOWED 0x04000000L // we can play the game in lil' window + +#define LGD3DF_CAN_DO_ITERATE_ALPHA 0x08000000L // can do Gouraud interpolation between vetices alpha color + + +/////////////////////////////////////////////////////////////////////////// + + + + +// Constants passed to lgd3d_set_pal_slot_flags() +#define LGD3DPALF_OPAQUE 1 +#define LGD3DPALF_TRANS 2 + +// pre-initiazation calls +extern void lgd3d_set_RGB(void); +extern void lgd3d_set_hardware(void); +extern void lgd3d_set_software(void); +extern void lgd3d_texture_set_RGB(bool is_RGB); + +// state query functions (won't change between init and shutdown) +extern BOOL lgd3d_is_RGB(void); +extern BOOL lgd3d_is_hardware(void); + +// initialization and shutdown + +//@TODO change this to return HRESULT error codes and support the message strings for them + +extern BOOL lgd3d_init( lgd3ds_device_info *device_info ); +// N.B. If the flag LGD3DF_DEPTH_BUFFER_REQUIRED was set in device_info->flags, +// and a depth buffer could not be created the call would fail. To test for this +// condition check whether the flags LGD3DF_ZBUFFER and LGD3DF_WBUFFER +// was UNSET in device_info->flags. + + + +extern BOOL lgd3d_attach_to_lgsurface( ILGSurface* pILGSurface ); +extern void lgd3d_clean_render_surface( BOOL bDepthBuffToo ); + +extern void lgd3d_shutdown(void); + +extern void lgd3d_start_frame(int frame); // frame count passed to texture manager +extern void lgd3d_end_frame(void); + +extern BOOL lgd3d_overlays_master_switch( BOOL bOverlaysOn ); + + + +extern void lgd3d_blit(); +extern void lgd3d_clear(int color_index); + +// application direct interface: death to COM! +extern void lgd3d_set_zwrite(BOOL zwrite); +extern void lgd3d_set_zcompare(BOOL zwrite); +extern void lgd3d_zclear(void); +extern void lgd3d_set_znearfar(double znear, double zfar); +extern void lgd3d_get_znearfar( double* pdZNear, double* pdZFar ); + +extern BOOL lgd3d_z_normal; + +//z-stuff +extern void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1); +extern void lgd3d_set_z(float z); // z coord for flat (2d) polys + +extern int /* D3DZBUFFERTYPE? */ lgd3d_get_depth_buffer_state( void ); +extern BOOL lgd3d_is_zwrite_on( void ); +extern BOOL lgd3d_is_zcompare_on( void ); + +// push all points closer to camera by zbias. +// returns old zbias. +extern double lgd3d_set_zbias(double zbias); + +// Z-Bias stack +#define LGD3D_ZBIAS_STACK_DEPTH 8 + +// 0 <= nZbias <= 16 +extern void lgd3d_push_zbias_i( int nZBias ); +extern void lgd3d_pop_zbias( void ); + +// States + + +//shading +// "smooth"(i.e., linera or bilinear) or "nearest point" +extern BOOL lgd3d_set_shading( BOOL bSmoothShading ); //NEW +extern BOOL lgd3d_is_smooth_shading_on( void ); + + + +//alpha blending +extern BOOL lgd3d_is_alpha_blending_on( void ); + +extern void lgd3d_set_alpha(float alpha); // 0.0 <= alpha <= 1.0 +extern void lgd3d_set_blend(BOOL do_blend); +extern void lgd3d_blend_normal(void); + +extern void lgd3d_blend_multiply(int blend_mode); //from below +enum { + BLEND_DEST_ZERO=0, + BLEND_SRC_ZERO=0, + BLEND_SRC_ONE=1, + BLEND_SRC_SRC=2, + BLEND_SRC_DEST=3, + BLEND_DEST_ONE=4, + BLEND_DEST_SRC=8, + BLEND_DEST_DEST=12 +}; + + +//efects: +// color range is 0..255 +extern void lgd3d_set_chromakey(int red, int green, int blue); + +extern void lgd3d_set_dithering( int bOn ); +extern int lgd3d_is_dithering_on( void ); + +extern void lgd3d_set_antialiasing( int bOn ); +extern int lgd3d_is_antialiasing_on( void ); + +extern BOOL lgd3d_enable_specular( BOOL bUseIt ); + +//fog +extern void lgd3d_set_fog_level(float fog_level); // 0.0 <= fog_level <= 1.0 +extern void lgd3d_set_fog_color(int r, int g, int b); // 0..255 +extern void lgd3d_set_fog_enable(BOOL enable); +extern void lgd3d_set_fog_density(float density); +extern BOOL lgd3d_is_fog_on( void ); + +// linear table fog + +// returns the previous setting +extern int lgd3d_use_linear_table_fog( BOOL bUseIt ); + +// fogginess: (end)____ +// / +// _____(start)/ + +// start and end are floats in "W-coordiantes", that is, in the [ z_near , z_far ]. +extern void lgd3d_set_fog_start_end( float fStart, float fEnd ); //please, check that z_near <= fStart < fEnd <= z_far + +// set the distance at which we should have full fog (results vary for different video cards) +extern void lgd3d_set_linear_fog_distance( float fDistance ); //please, check that fStart <= fDistance <= fEnd + +//Textures: + +extern void lgd3d_set_texture_level( int n ); +extern void lgd3d_get_texblending_modes( ulong* pulLevel0Mode, ulong* pulLevel1Mode ); + +//texture manager +#define lgd3d_set_texture(bm) \ +do if (g_tmgr) g_tmgr->set_texture(bm); while (0) + +#define lgd3d_load_texture(bm) \ +do if (g_tmgr) g_tmgr->load_texture(bm); while (0) + +#define lgd3d_unload_texture(bm) \ +do if (g_tmgr) g_tmgr->unload_texture(bm); while (0) + +// procedural textures +extern void lgd3d_hack_light(r3s_point *p, float r); +extern void lgd3d_hack_light_extra(r3s_point *p, float r, grs_bitmap *bm); + +// texture wrapping +// TRUE == wrap the texture (texture is a torus), +// FALSE == clamp the texture (texture is a closed rectangle) +extern BOOL lgd3d_get_texture_wrapping( DWORD dwLevel ); +extern BOOL lgd3d_set_texture_wrapping( DWORD dwLevel, BOOL bSetSmooth ); + + +// palettes +extern void lgd3d_set_pal(uint start, uint n, uchar *pal); +extern void lgd3d_set_pal_slot(uint start, uint n, uchar *pal, int slot); +extern void lgd3d_set_pal_slot_flags(uint start, uint n, uchar *pal, int slot, int flags); + +extern void lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask *bitmask); +extern void lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask *bitmask); +extern void lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask *bitmask); + +extern void lgd3d_set_texture_clut(uchar *clut); +extern uchar *lgd3d_set_clut(uchar *clut); + +extern void lgd3d_disable_palette(void); +extern void lgd3d_enable_palette(void); + +extern void lgd3d_set_alpha_pal(ushort *pal); + + +extern void lgd3d_set_offsets(int x, int y); +extern void lgd3d_get_offsets(int *x, int *y); + + + +// drawing: + +extern int lgd3d_draw_point(r3s_point *p); +extern void lgd3d_draw_line(r3s_point *p0, r3s_point *p1); + + +//Poligon Drowing states +//NOTE: for now it does *NOT* affect indexed and multytextured polies + +typedef enum ePolyMode{ + kLgd3dPolyModeFillWTexture = 0x00000001L, + kLgd3dPolyModeFillWColor = 0x00000002L, + kLgd3dPolyModeDrawEdges = 0x00000004L, // use color + + kLgd3dPolyModeDefault = 0x00000001L, // normal, == kLgd3dPolyModeFillTexture + kLgd3dPolyModeWireframe = 0x00000004L, // == kLgd3dPolyModeDrawEdges + kLgd3dPolyModeOutlineTex = 0x00000005L, // == kLgd3dPolyModeFillWTexture + kLgd3dPolyModeDrawEdges + kLgd3dPolyModeOutlineColor = 0x00000006L, // == kLgd3dPolyModeFillWColor + kLgd3dPolyModeDrawEdges + + kLgd3dILLEGALPolyMode = 0x00000000L +} ePolyMode; + +extern BOOL lgd3d_set_poly_mode( ePolyMode eNewMode ); +extern ePolyMode lgd3d_get_poly_mode(); + + +extern int lgd3d_trifan(int n, r3s_point **vpl); +extern int lgd3d_lit_trifan(int n, r3s_point **vpl); +extern int lgd3d_poly(int n, r3s_point **vpl); +extern int lgd3d_spoly(int n, r3s_point **vpl); +extern int lgd3d_g2upoly(int n, g2s_point **vpl); +extern int lgd3d_g2poly(int n, g2s_point **vpl); +extern int lgd3d_g2utrifan(int n, g2s_point **vpl); +extern int lgd3d_g2trifan(int n, g2s_point **vpl); + + +// r3d interface +typedef int (*tLgd3dDrawPolyFunc)(int n, r3s_phandle *pl); + +extern tLgd3dDrawPolyFunc lgd3d_draw_poly_func; + +extern void lgd3d_tmap_setup(grs_bitmap *bm); +extern void lgd3d_lit_tmap_setup(grs_bitmap *bm); +extern void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); +extern void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); +extern void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); // rgba + fog +extern void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); // rgba + fog +extern void lgd3d_poly_setup(grs_bitmap *bm); +extern void lgd3d_spoly_setup(grs_bitmap *bm); +extern void lgd3d_rgb_poly_setup(grs_bitmap *bm); +extern void lgd3d_rgba_poly_setup(grs_bitmap *bm); + + +// indexed primitives: + +typedef int (*tLgd3dDrawPolyIndexedFunc)( int n, r3s_phandle *pl, r3ixs_info *info ); + +extern tLgd3dDrawPolyIndexedFunc lgd3d_draw_poly_indexed_func; + +typedef void (*fp_release_IP)( void ); + +extern fp_release_IP lgd3d_release_ip_func; + +extern int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); +extern int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); +extern void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); +extern int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); + +extern int lgd3d_release_indexed_primitives( void ); + + + +/////////////////////////////////// + +// Multi texturing + +//used for single level texturing +#define LGD3DTB_MODULATE 0L //default +#define LGD3DTB_MODULATEALPHA 1L +#define LGD3DTB_BLENDDIFFUSE 2L + +#define LGD3DTB_NO_STATES 3L + +extern void lgd3d_set_texture_map_method( ulong flag ); + +//2 levels texturing: +#define LGD3D_MULTITEXTURE_COLOR 0L //default +#define LGD3D_MULTITEXTURE_ALPHA 1L +#define LGD3D_MULTITEXTURE_BLEND_TEX_ALPHA 2L + +#define LGD3D_MULTITEXTURE_NO_STATES 3L + +extern void lgd3d_set_light_map_method( ulong flag ); //from the above + + +// additional sets of texture coordinates are added +typedef struct { + float u, v; +} LGD3D_tex_coord; + + + + +extern int lgd3d_TrifanMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); +extern int lgd3d_LitTrifanMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); +extern int lgd3d_RGBlitTrifanMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); +extern int lgd3d_RGBAlitTrifanMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); +extern int lgd3d_RGBAFoglitTrifanMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); +extern int lgd3d_DiffuseSpecularMTD( int n, r3s_point **ppl, LGD3D_tex_coord **pptc ); + +extern int lgd3d_g2UTrifanMTD( int n, g2s_point **vpl, LGD3D_tex_coord **vptc ); +extern int lgd3d_g2TrifanMTD( int n, g2s_point **vpl, LGD3D_tex_coord **vptc ); + + + +// error codes:( the first argument of "lgd3d_get_error" ) +#define LGD3D_EC_OK 0L +#define LGD3D_EC_DD_KAPUT 1L +#define LGD3D_EC_RESTORE_ALL_SURFS 2L +#define LGD3D_EC_QUERY_D3D 3L +#define LGD3D_EC_GET_DD_CAPS 4L +#define LGD3D_EC_ZBUFF_ENUMERATION 5L +#define LGD3D_EC_CREATE_3D_DEVICE 6L +#define LGD3D_EC_CREATE_VIEWPORT 7L +#define LGD3D_EC_ADD_VIEWPORT 8L +#define LGD3D_EC_SET_VIEWPORT 9L +#define LGD3D_EC_SET_CURR_VP 10L +#define LGD3D_EC_CREATE_BK_MATERIAL 11L +#define LGD3D_EC_SET_BK_MATERIAL 12L +#define LGD3D_EC_GET_BK_MAT_HANDLE 13L +#define LGD3D_EC_GET_SURF_DESC 14L +#define LGD3D_EC_GET_3D_CAPS 15L +#define LGD3D_EC_VD_MPASS_MT 16L +#define LGD3D_EC_VD_S_DEFAULT 17L +#define LGD3D_EC_VD_SPASS_MT 18L +#define LGD3D_EC_VD_M_DEFAULT 19L +#define LGD3D_EC_VD_SPASS_BLENDDIFFUSE 20L +#define LGD3D_EC_VD_MPASS_BLENDDIFFUSE 21L + + + +BOOL lgd3d_get_error( DWORD* pdwCode, DWORD* phResult ); + + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/libsrc/lgd3d/lgd3d.vcxproj b/libsrc/lgd3d/lgd3d.vcxproj index f70ad77..902fcfd 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj +++ b/libsrc/lgd3d/lgd3d.vcxproj @@ -36,7 +36,10 @@ + + + 16.0 diff --git a/libsrc/lgd3d/lgd3d.vcxproj.filters b/libsrc/lgd3d/lgd3d.vcxproj.filters index ab79207..2834cc1 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj.filters +++ b/libsrc/lgd3d/lgd3d.vcxproj.filters @@ -15,22 +15,19 @@ - + Header Files - + Header Files - - Header Files - - + Header Files - + Header Files - + Header Files @@ -39,39 +36,42 @@ Header Files - + Header Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + + Source Files + + Source Files diff --git a/libsrc/lgd3d/texmgr.cpp b/libsrc/lgd3d/texmgr.cpp index 7f97149..8e57f21 100644 --- a/libsrc/lgd3d/texmgr.cpp +++ b/libsrc/lgd3d/texmgr.cpp @@ -1,4 +1,5 @@ #include +#include #include diff --git a/libsrc/lgd3d/tmgr.h b/libsrc/lgd3d/tmgr.h new file mode 100644 index 0000000..be50624 --- /dev/null +++ b/libsrc/lgd3d/tmgr.h @@ -0,0 +1,69 @@ +/* +@Copyright Looking Glass Studios, Inc. +1996,1997,1998,1999,2000 Unpublished Work. +*/ + +// $Header: x:/prj/tech/libsrc/lgd3d/RCS/tmgr.h 1.18 1998/09/18 16:13:05 KEVIN Exp $ +#ifndef __TMGR_H +#define __TMGR_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct grs_bitmap grs_bitmap; + +#define TMGR_SUCCESS 0 +#define TMGR_FAILURE -1 +#define BMF_LOADED 0x40 + +#define TMGRF_SPEW 1 + +#define TF_ALPHA 1 +#define TF_RGB 2 +#define TF_TRANS 4 + + +typedef struct texture_manager { + int (*init)(grs_bitmap *bm, int max_textures, int *texture_size_list, int num_texture_sizes, int flags); + void (*shutdown)(void); + void (*start_frame)(int frame); + void (*end_frame)(void); + void (*load_texture)(grs_bitmap *bm); + void (*unload_texture)(grs_bitmap *bm); + void (*set_texture)(grs_bitmap *bm); + void (*set_texture_callback)(void); + void (*stats)(void); // spew stats to the mono screen + uint (*bytes_loaded)(void); // bytes downloaded this frame + BOOL (*get_utilization)(float *utilization); + uchar *(*set_clut)(uchar *clut); + void (*restore_bits)(grs_bitmap *bm); + void (*reload_texture)(grs_bitmap *bm); +} texture_manager; + +typedef struct tmap_chain +{ + int head; +} tmap_chain; + +typedef struct tmgr_texture_info +{ + grs_bitmap* bitmap; + uchar* bits; + int frame; + uchar* clut; + int next; + int size_index; + uint cookie; +} tmgr_texture_info; + + +//zb +extern texture_manager *get_dopey_texture_manager( void* driver ); + + +extern texture_manager *g_tmgr; // this is kinda silly, but it'll do for now... + +#ifdef __cplusplus +} +#endif +#endif diff --git a/libsrc/r3d/primd3d.c b/libsrc/r3d/primd3d.c index e4e8be6..e4cce01 100644 --- a/libsrc/r3d/primd3d.c +++ b/libsrc/r3d/primd3d.c @@ -18,8 +18,12 @@ static poly_setup_func poly_lgd3d_setup_funcs[] = lgd3d_spoly_setup, // solid gouraud clipped lgd3d_rgb_poly_setup, // solid rgb gouraud lgd3d_rgb_poly_setup, // solid rgb gouraud clipped - lgd3d_poly_setup_null, // solid pal gouraud - lgd3d_poly_setup_null, // solid pal gouraud clipped + lgd3d_rgba_poly_setup, // solid pal gouraud + lgd3d_rgba_poly_setup, // solid pal gouraud clipped + lgd3d_rgba_poly_setup, + lgd3d_rgba_poly_setup, + lgd3d_rgba_poly_setup, + lgd3d_rgba_poly_setup, // 4 lgd3d_poly_setup_null, // transluc unlit @@ -30,6 +34,10 @@ static poly_setup_func poly_lgd3d_setup_funcs[] = lgd3d_poly_setup_null, // transluc rgb gouraud clipped lgd3d_poly_setup_null, // transluc pal gouraud lgd3d_poly_setup_null, // transluc pal gouraud clipped + lgd3d_poly_setup_null, + lgd3d_poly_setup_null, + lgd3d_poly_setup_null, + lgd3d_poly_setup_null, // 8 lgd3d_tmap_setup, // texture unlit @@ -38,8 +46,12 @@ static poly_setup_func poly_lgd3d_setup_funcs[] = lgd3d_lit_tmap_setup, // texture gouraud clipped lgd3d_rgblit_tmap_setup, // texture rgb gouraud lgd3d_rgblit_tmap_setup, // texture rgb gouraud clipped - lgd3d_poly_setup_null, // texture pal gouraud - lgd3d_poly_setup_null, // texture pal gouraud clipped + lgd3d_rgbalit_tmap_setup, // texture pal gouraud + lgd3d_rgbalit_tmap_setup, // texture pal gouraud clipped + lgd3d_rgbafoglit_tmap_setup, + lgd3d_rgbafoglit_tmap_setup, + lgd3d_diffspecular_tmap_setup, + lgd3d_diffspecular_tmap_setup, // 16 lgd3d_tmap_setup, // texture unlit @@ -48,8 +60,12 @@ static poly_setup_func poly_lgd3d_setup_funcs[] = lgd3d_lit_tmap_setup, // texture gouraud clipped lgd3d_rgblit_tmap_setup, // linear rgb gouraud lgd3d_rgblit_tmap_setup, // linear rgb gouraud clipped - lgd3d_poly_setup_null, // linear pal gouraud - lgd3d_poly_setup_null // linear pal gouraud clipped + lgd3d_rgbalit_tmap_setup, // linear pal gouraud + lgd3d_rgbalit_tmap_setup, // linear pal gouraud clipped + lgd3d_rgbafoglit_tmap_setup, + lgd3d_rgbafoglit_tmap_setup, + lgd3d_diffspecular_tmap_setup, + lgd3d_diffspecular_tmap_setup }; static int lgd3d_convert(int n, r3s_phandle *vp) From 882cdfce639b61c970376da8090ec824fa1c5119 Mon Sep 17 00:00:00 2001 From: shad0ff Date: Thu, 4 Jul 2024 20:16:24 +0300 Subject: [PATCH 18/35] full States code and some refactoring --- libsrc/lgd3d/d6Base.cpp | 63 +- libsrc/lgd3d/d6Enum.cpp | 35 +- libsrc/lgd3d/d6Render.cpp | 4 +- libsrc/lgd3d/d6Render.h | 6 +- libsrc/lgd3d/d6States.h | 24 +- libsrc/lgd3d/d6sts_s.cpp | 2750 +++++++++++++++++++++++++++++++++---- libsrc/lgd3d/lgd3d.h | 4 + libsrc/lgd3d/lgd3d_g.cpp | 8 + libsrc/lgd3d/tmgr.h | 8 +- thief2.sdf | Bin 0 -> 327680 bytes thief2.v11.suo | Bin 0 -> 46592 bytes 11 files changed, 2576 insertions(+), 326 deletions(-) create mode 100644 thief2.sdf create mode 100644 thief2.v11.suo diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index ea793c5..37dd386 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -5,6 +5,13 @@ #include #include +#include + +double z_near = 1.0, z_far = 200, inv_z_far = 0.005; +double z1 = 1.005025125628141, z2 = 1.005025125628141; +double z2d = 1.0, w2d = 1.0; +double zbias; + static DWORD dwErrorCode; static int hD3DError; @@ -475,4 +482,58 @@ const char* GetDDErrorMsg(long hRes) default: return "Unrecognized error value."; } -} \ No newline at end of file +} + +void set1(D3DMATRIX* m) +{ + m->_24 = 0.0; + m->_23 = 0.0; + m->_21 = 0.0; + m->_14 = 0.0; + m->_13 = 0.0; + m->_12 = 0.0; + m->_43 = 0.0; + m->_42 = 0.0; + m->_41 = 0.0; + m->_34 = 0.0; + m->_32 = 0.0; + m->_31 = 0.0; + m->_44 = 1.0; + m->_33 = 1.0; + m->_22 = 1.0; + m->_11 = 1.0; +} + +void setwbnf(IDirect3DDevice3* lpDev, double dvWNear, double dvWFar) +{ + // WVP + D3DMATRIX matWorld, matView, matProj; + float Q; + + set1(&matWorld); + set1(&matView); + set1(&matProj); + if (dvWFar > dvWNear) + { + lpDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); + lpDev->SetTransform(D3DTRANSFORMSTATE_VIEW, &matView); + Q = dvWFar / (dvWFar - dvWNear); + matProj._33 = Q; + matProj._43 = -dvWNear * Q; + matProj._34 = 1.0; + matProj._44 = 0.0; + lpDev->SetTransform(D3DTRANSFORMSTATE_PROJECTION, &matProj); + } +} + +void lgd3d_set_znearfar(double znear, double zfar) +{ + z_near = znear; + z_far = zfar; + inv_z_far = 1.0 / zfar; + z1 = zfar / (zfar - znear); + z2 = znear * z1; + z1 = z1 - zbias; + if (pcStates) + setwbnf(g_lpD3Ddevice, znear, zfar); +} diff --git a/libsrc/lgd3d/d6Enum.cpp b/libsrc/lgd3d/d6Enum.cpp index 8cdf376..b64d9de 100644 --- a/libsrc/lgd3d/d6Enum.cpp +++ b/libsrc/lgd3d/d6Enum.cpp @@ -69,7 +69,7 @@ void lgd3d_unenumerate_devices() { for (int i = 0; i < nNoDevices; ++i) { - delete psDeviceList; // FIXME char[] + delete psDeviceList[i]; // FIXME char[] psDeviceList[i] = nullptr; } @@ -90,14 +90,14 @@ void GetDevices(LGD3D_sEnumerationInfo* info) IDirectDraw* lpdd = nullptr; if (FAILED(DynDirectDrawCreate(p_ddraw_guid, &lpdd, nullptr))) { - DbgReportWarning("Can't create ddraw object.\n"); + Warning(("Can't create ddraw object.\n")); return; } IDirectDraw4* lpdd4 = nullptr; if (lpdd->QueryInterface(IID_IDirectDraw4, reinterpret_cast(&lpdd4)) != S_OK) { - DbgReportWarning("Can't obtain DDraw4 interface.\n"); + Warning(("Can't obtain DDraw4 interface.\n")); SafeRelease(lpdd); return; } @@ -106,7 +106,7 @@ void GetDevices(LGD3D_sEnumerationInfo* info) ddcaps.dwSize = sizeof(ddcaps); if (lpdd4->GetCaps(&ddcaps, nullptr) != DD_OK || (ddcaps.dwCaps & DDCAPS_3D) == 0) { - DbgReportWarning("Not a 3d accelerator.\n"); + Warning(("Not a 3d accelerator.\n")); SafeRelease(lpdd4); SafeRelease(lpdd); return; @@ -118,7 +118,7 @@ void GetDevices(LGD3D_sEnumerationInfo* info) IDirect3D3* lpd3d = nullptr; if (lpdd4->QueryInterface(IID_IDirect3D3, reinterpret_cast(&lpd3d)) != S_OK) { - DbgReportWarning("Can't obtain D3D interface.\n"); + Warning(("Can't obtain D3D interface.\n")); SafeRelease(lpdd4); SafeRelease(lpdd); return; @@ -129,11 +129,11 @@ void GetDevices(LGD3D_sEnumerationInfo* info) lpdd4->EnumDisplayModes(0, nullptr, info, c_EnumDisplayModesCallback); if (info->num_supported <= 0) { - DbgReportWarning("Couldn't find any display modes.\n"); + Warning(("Couldn't find any display modes.\n")); } else if (lpd3d->EnumDevices(c_EnumDevicesCallback, info)) { - DbgReportWarning("EnumDevices failed.\n"); + Warning(("EnumDevices failed.\n")); } SafeRelease(lpd3d); @@ -212,7 +212,7 @@ HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) { - capabilities_flags = 0x80000; + capabilities_flags = LGD3DF_CAN_DO_TABLE_FOG; } else if (info->requested_flags & LGD3DF_TABLE_FOG) { @@ -222,7 +222,7 @@ HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) { - capabilities_flags |= 0x100000u; + capabilities_flags |= LGD3DF_CAN_DO_VERTEX_FOG; } else if (info->requested_flags & LGD3DF_VERTEX_FOG) { @@ -231,29 +231,28 @@ HRESULT CALLBACK c_EnumDevicesCallback(GUID* lpGuid, LPSTR lpDeviceDescription, } if (pDeviceDesc->dpcTriCaps.dwShadeCaps & D3DPRASTERCAPS_ZBIAS) - capabilities_flags |= 0x8000000u; + capabilities_flags |= LGD3DF_CAN_DO_ITERATE_ALPHA; if (bDepthBuffer) { - capabilities_flags |= 0x10000u; + capabilities_flags |= LGD3DF_CAN_DO_ZBUFFER; if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) - capabilities_flags |= 0x40000u; + capabilities_flags |= LGD3DF_CAN_DO_WBUFFER; } if (bWindowed) - capabilities_flags |= 0x4000000u; + capabilities_flags |= LGD3DF_CAN_DO_WINDOWED; if (pDeviceDesc->wMaxTextureBlendStages >= 2 && pDeviceDesc->wMaxSimultaneousTextures >= 2 && pDeviceDesc->dwFVFCaps >= 2) - capabilities_flags |= 0x2000000u; + capabilities_flags |= LGD3DF_CAN_DO_SINGLE_PASS_MT; if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) - capabilities_flags |= 0x200000u; + capabilities_flags |= LGD3DF_CAN_DO_SINGLE_PASS_MT; if (pDeviceDesc->dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) - capabilities_flags |= 0x400000u; + capabilities_flags |= LGD3DF_CAN_DO_ANTIALIAS; - if (info->device_number >= MAX_DEVICE_NUMBER) - CriticalMsg("Too many d3d devices available."); + AssertMsg(info->device_number < MAX_DEVICE_NUMBER, "Too many d3d devices available."); lgd3ds_device_info* device_info; auto malloc_size = strlen(info->p_ddraw_desc) + sizeof(short) * info->num_supported + 291; diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp index 9f4ddd8..1e6def1 100644 --- a/libsrc/lgd3d/d6Render.cpp +++ b/libsrc/lgd3d/d6Render.cpp @@ -26,7 +26,7 @@ void cD6Renderer::DeleteStatesStack() { } -int cD6Renderer::SwitchOverlaysOnOff(bool bOn) +int cD6Renderer::SwitchOverlaysOnOff(BOOL bOn) { return 0; } @@ -43,7 +43,7 @@ void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) { } -void cD6Renderer::CleanRenderSurface(bool bDepthBufferToo) +void cD6Renderer::CleanRenderSurface(BOOL bDepthBufferToo) { } diff --git a/libsrc/lgd3d/d6Render.h b/libsrc/lgd3d/d6Render.h index 87e8e98..ee89fdc 100644 --- a/libsrc/lgd3d/d6Render.h +++ b/libsrc/lgd3d/d6Render.h @@ -19,11 +19,11 @@ class cD6Renderer { void DeleteStatesStack(); public: - int SwitchOverlaysOnOff(bool bOn); + int SwitchOverlaysOnOff(BOOL bOn); void StartFrame(int nFrame); void EndFrame(); void CleanDepthBuffer(int x1, int y1, int x2, int y2); - void CleanRenderSurface(bool bDepthBufferToo); + void CleanRenderSurface(BOOL bDepthBufferToo); long InitViewport(); DWORD m_dwEntrySize; @@ -35,5 +35,5 @@ class cD6Renderer { DWORD* m_pdwRSCData; char* m_pCurrentEntry; char* m_pSetEntry; - bool m_bOverlaysOn; + BOOL m_bOverlaysOn; }; \ No newline at end of file diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index d763687..8066dae 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -89,6 +89,8 @@ typedef struct class cD6States { + friend class cMSStates; + public: virtual int Initialize(DWORD dwRequestedFlags); @@ -120,7 +122,8 @@ class cD6States // copy ctr was created by compiler // cD6States(const cD6States &); cD6States(); - virtual ~cD6States(); + // also abstract + virtual ~cD6States() = 0; public: int load_texture(tdrv_texture_info *info); @@ -153,13 +156,13 @@ class cD6States void SetAntialiasing(BOOL bOn); int GetAntialiasingState(); virtual void EnableDepthBuffer(int nFlag); - int GetDepthBufferState(); + D3DZBUFFERTYPE GetDepthBufferState(); virtual void SetZWrite(BOOL bZWriteOn); - bool IsZWriteOn(); + BOOL IsZWriteOn(); virtual void SetZCompare(BOOL bZCompreOn); - bool IsZCompareOn(); + BOOL IsZCompareOn(); virtual void SetFogDensity(float fDensity); - int UseLinearTableFog(BOOL bOn); + BOOL UseLinearTableFog(BOOL bOn); void SetFogStartAndEnd(float fStart, float fEnd); void SetLinearFogDistance(float fDistance); void SetAlphaColor(float fAlpha); @@ -169,22 +172,22 @@ class cD6States void ResetDefaultAlphaModulate(); void SetTextureMapMode(DWORD dwFlag); void GetTexBlendingModes(DWORD *pdw0LevelMode, DWORD *pdw1LevelMode); - int SetSmoothShading(BOOL bSmoothOn); + BOOL SetSmoothShading(BOOL bSmoothOn); BOOL IsSmoothShadingOn(); void EnableFog(BOOL bFogOn); BOOL IsFogOn(); void SetFogSpecularLevel(float fLevel); void SetFogColor(int r, int g, int b); unsigned long get_color(); - void SetTexturePalette(int start, int n, uint8 *pal, int slot); + void SetTexturePalette(int start, int n, uchar *pal, int slot); void EnablePalette(BOOL bPalOn); BOOL IsPaletteOn(); void SetPalSlotFlags(int start, int n, uint8 *pal_data, int slot, char flags); void SetAlphaPalette(uint16 *pal); virtual void SetChromaKey(int r, int g, int b); int GetTexWrapping(DWORD dwLevel); - int SetTexWrapping(DWORD dwLevel, bool bSetSmooth); - int EnableSpecular(bool bUseIt); + BOOL SetTexWrapping(DWORD dwLevel, BOOL bSetSmooth); + BOOL EnableSpecular(BOOL bUseIt); private: float LinearWorldIntoFogCoef(float fLin); @@ -217,12 +220,13 @@ extern cD6States* pcStates; extern IDirect3DDevice3* g_lpD3Ddevice; extern IDirectDraw4* g_lpDD_ext; extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; +extern BOOL g_bTexSuspended; extern int bSpewOn; extern char* GetDDErrorMsg(int hRes); extern int g_bPrefer_RGB; extern void SetLGD3DErrorCode(ulong dwCode, long hRes); -extern char* GetLgd3dErrorCode(ulong dwErrorCode); +extern const char* GetLgd3dErrorCode(ulong dwErrorCode); extern BOOL lgd3d_g_bInitialized; diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 4b4090a..8ff1193 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -1,4 +1,6 @@ - +// @SH_CODE +#include +#include // min() and max(). #include #include @@ -10,8 +12,6 @@ #include -BOOL lgd3d_blend_trans = TRUE; - #ifndef SHIP #define mono_printf(x) \ if (bSpewOn) \ @@ -20,7 +20,15 @@ BOOL lgd3d_blend_trans = TRUE; #define mono_printf(x) #endif +#ifdef MONO_SPEW +#define put_mono(c) (*((uchar *)0xb0078)) = (c) // hello dossie +#else +#define put_mono(c) +#endif + // #include "d3dmacs.h" +#include "tmgr.h" // for g_tmgr +#include #include "d6States.h" #include #include @@ -37,7 +45,7 @@ static char* pcDXef = (char*)"%s: error %d\n%s"; static char* pcLGD3Def = (char*)"LGD3D error no %d : %s : message: %d\n%s"; #define CheckHResult(hRes, msg) \ -AssertMsg3(hRes==0, hResErrorMsg, msg, (hRes>>16)&0x7fff, hRes&0xffff) +AssertMsg3(hRes==0, pcDXef, msg, hRes, GetDDErrorMsg(hRes)) extern cD6Primitives* pcRenderBuffer; extern cD6Renderer* pcRenderer; @@ -45,32 +53,33 @@ extern cD6Renderer* pcRenderer; class cImStates : public cD6States { public: - cD6States *Instance(); + // singleton? + static cD6States* Instance(); virtual cD6States *DeInstance() override; protected: - cImStates(const class cImStates &); + // cImStates(const class cImStates &); cImStates(); virtual ~cImStates(); private: - cImStates *m_Instance; + static cImStates *m_Instance; }; class cMSStates : public cD6States { public: - cD6States * Instance(); + static cD6States * Instance(); virtual cD6States * DeInstance() override; virtual int Initialize(DWORD dwRequestedFlags) override; virtual int SetDefaultsStates(DWORD dwRequestedFlags) override; protected: - cMSStates(const cMSStates &); + // cMSStates(const cMSStates &); cMSStates(); virtual ~cMSStates(); private: - cMSStates * m_Instance; + static cMSStates * m_Instance; unsigned long m_dwCurrentTexLevel; int m_bTexturePending; grs_bitmap * m_LastLightMapBm; @@ -85,6 +94,20 @@ class cMSStates : public cD6States { virtual void TurnOffTexuring(BOOL bTexOff) override; }; +#define PF_GENERIC 0 +#define PF_RGB 1 +#define PF_ALPHA 2 +#define PF_MASK 3 +#define PF_RGBA 4 +#define PF_MAX 4 +#define PF_STAGE 64 +#define PF_TRANS 128 + +#define GBitMask15 0x3e0 +#define GBitMask16 0x7e0 + +#define MAX_PALETTES 256 + DDPIXELFORMAT* g_FormatList[5]; #define LGD3D_MAX_TEXTURES 1024 @@ -93,10 +116,11 @@ sTextureData g_saTextures[LGD3D_MAX_TEXTURES]; DDPIXELFORMAT g_RGBTextureFormat; DDPIXELFORMAT g_TransRGBTextureFormat, g_PalTextureFormat, g_AlphaTextureFormat, g_8888TexFormat; +BOOL g_bTexSuspended; -ushort* texture_pal_trans[256]; -IDirectDrawPalette* lpDDPalTexture[256]; -ushort* texture_pal_opaque[256]; +ushort* texture_pal_trans[MAX_PALETTES]; +IDirectDrawPalette* lpDDPalTexture[MAX_PALETTES]; +ushort* texture_pal_opaque[MAX_PALETTES]; ushort default_alpha_pal[256]; BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; @@ -114,6 +138,9 @@ grs_bitmap* default_bm; ushort* alpha_pal; static int callback_id; +cImStates* cImStates::m_Instance = NULL; +cMSStates* cMSStates::m_Instance = NULL; + int alpha_size_table[81], generic_size_table[81], rgb_size_table[81], trgb_size_table[81], b8888_size_table[81]; sTexBlendArgs sTexBlendArgsProtos[3][2] = @@ -134,7 +161,8 @@ sTexBlendArgs sMultiTexBlendArgsProtos[3][2] = int b_SS2_UseSageTexManager; ushort** texture_pal_list[4] = { texture_pal_opaque, texture_pal_opaque, /* is it working? */ &alpha_pal, texture_pal_trans}; - +BOOL lgd3d_blend_trans = TRUE; +static D3DBLEND table[4] = { D3DBLEND_ZERO, D3DBLEND_ONE, D3DBLEND_SRCCOLOR, D3DBLEND_DESTCOLOR }; void GetAvailableTexMem(ulong* local, ulong* agp); @@ -163,231 +191,59 @@ void init_size_table(int *size_table, unsigned __int8 type); int munge_size_tables(int **p_size_list); int get_num_sizes(int *size_list, int num_sizes, int *size_table); - -void CheckSurfaces(sWinDispDevCallbackInfo* info) +D3DZBUFFERTYPE cD6States::GetDepthBufferState() { - int message; - IDirectDrawSurface4* lpTS; - int i; - - message = info->message; - - if (message == kCallbackChainAddFunc) - { - GenericCallbackChainHandler(&callback_id, (void(**)(callback_chain_info*))&chain, &info->chain_info); - } - else if (message == kCallbackChainRemoveFunc) - { - for (i = 0; i < 1024; i++) - { - lpTS = g_saTextures[i].lpSurface; - if (lpTS && lpTS->IsLost() == DDERR_SURFACELOST) - { - if (lpTS->Restore()) - DbgReportWarning("Could not restore lost surface %i!\n", i); - if (g_saTextures[i].pTdrvBitmap) - { - if (!g_tmgr) - CriticalMsg("Hmmm. Should have a non-NULL texture manager here."); - g_tmgr->unload_texture(g_saTextures[i].pTdrvBitmap); - } - } - } - } - - if (chain) - chain(info); + return m_psCurrentRS->eZenable; } -int STDMETHODCALLTYPE EnumTextureFormatsCallback(DDPIXELFORMAT* lpDDPixFmt, void* lpContext) +BOOL cD6States::IsZWriteOn() { - if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) - { - if (bSpewOn) - mprintf("8 bit palette indexed format\n"); - } - else if ((lpDDPixFmt->dwFlags & DDPF_ALPHA) != 0) - { - if (bSpewOn) - mprintf("Alpha format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount); - } - else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0) - { - if (bSpewOn) - mprintf("RGB format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount); - if (bSpewOn) - mprintf("bitmasks: A %x, R %x G %x B %x\n", lpDDPixFmt->dwRGBAlphaBitMask, lpDDPixFmt->dwRBitMask, lpDDPixFmt->dwGBitMask, lpDDPixFmt->dwBBitMask); - } - else if (bSpewOn) - { - mprintf("other format: %i\n", lpDDPixFmt->dwFlags); - } - - if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 16) - { - if (lpDDPixFmt->dwRGBAlphaBitMask == 0xF000 && lpDDPixFmt->dwRBitMask == 0xF00 && lpDDPixFmt->dwGBitMask == 0xF0 && lpDDPixFmt->dwBBitMask == 0xF) - { - memcpy(&g_AlphaTextureFormat, lpDDPixFmt, sizeof(g_AlphaTextureFormat)); - } - else if (lpDDPixFmt->dwRGBAlphaBitMask == 0x8000 && lpDDPixFmt->dwGBitMask == 0x3E0) - { - memcpy(&g_TransRGBTextureFormat, lpDDPixFmt, sizeof(g_TransRGBTextureFormat)); - } - else if (lpDDPixFmt->dwGBitMask == 0x7E0 || lpDDPixFmt->dwGBitMask == 0x3E0 && !g_RGBTextureFormat.dwFlags) - { - memcpy(&g_RGBTextureFormat, lpDDPixFmt, sizeof(g_RGBTextureFormat)); - } - } - else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 32) - { - if (lpDDPixFmt->dwRGBAlphaBitMask == 0xFF000000 && lpDDPixFmt->dwRBitMask == 0xff0000 && lpDDPixFmt->dwBBitMask == 255) - { - memcpy(&g_8888TexFormat, lpDDPixFmt, sizeof(g_8888TexFormat)); - g_b8888supported = TRUE; - } - } - else if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) - { - memcpy(&g_PalTextureFormat, lpDDPixFmt, sizeof(g_PalTextureFormat)); - } - - return TRUE; + return m_psCurrentRS->bZWriteEnable; } -int FindClosestColor(float r, float g, float b) +BOOL cD6States::IsZCompareOn() { - float dg, dr, db; - float test; - byte* pal; - int i; - int color; - float best; - - best = 196608.0; - pal = grd_pal; - color = -1; - - for (i = 0; i < 256; i++) - { - dr = r - (float)pal[i * 3 + 0]; - dg = g - (float)pal[i * 3 + 1]; - db = b - (float)pal[i * 3 + 2]; - test = dr * dr + db * db + dg * dg; - if (test < (float)best) - { - best = dr * dr + db * db + dg * dg; - color = i; - } - } - if (color < 0) - CriticalMsg("Couldn't fit color."); - return color; + return m_psCurrentRS->eZCompareFunc == D3DCMP_LESSEQUAL; } -int get_num_sizes(int* size_list, int num_sizes, int* size_table) +BOOL cD6States::IsAlphaBlendingOn() { - int i, j; - - for (i = 0; i < 81; ++i) - { - if (size_table[i] != -1) - { - for (j = 0; j < num_sizes && size_list[j] != size_table[i]; ++j) - ; - if (j == num_sizes) - size_list[num_sizes++] = size_table[i]; - size_table[i] = j; - } - } - return num_sizes; + return m_psCurrentRS->bAlphaOn; } -int munge_size_tables(int** p_size_list) +BOOL cD6States::IsSmoothShadingOn() { - int* size_list; - int num_sizes; - - size_list = (int*)malloc(1620); - num_sizes = get_num_sizes(size_list, - get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, 0, alpha_size_table), - generic_size_table), rgb_size_table), trgb_size_table), b8888_size_table); - *p_size_list = (int*)Realloc(size_list, 4 * num_sizes); - return num_sizes; + return m_psCurrentRS->eShadeMode == D3DSHADE_GOURAUD; } -void init_size_table(int* size_table, byte type) +BOOL cD6States::IsFogOn() { - int i, j; - tdrv_texture_info info; - int w, h; - d3d_cookie cookie; - - info.id = 0; - cookie.flags = type; - - for (i = 0, w = 1; i < 81; i += 9, w *= 2) - { - for (j = 0, h = 1; j < 9; j++, h *= 2) - { - info.bm = gr_alloc_bitmap((type != 0 && type != TF_RGB) ? (type == TF_TRANS ? BMT_FLAT32 : BMT_FLAT16) : BMT_FLAT8, 0, w, h); - info.scale_h = 0; - info.scale_w = 0; - info.w = info.bm->w; - info.h = info.bm->h; - info.size_index = -1; - info.bits = info.bm->bits; - cookie.wlog = info.bm->wlog; - cookie.hlog = info.bm->hlog; - info.cookie = cookie.value; - - if (pcStates->load_texture(&info) == -1) - { - size_table[j + i] = -1; - } - else - { - if (b_SS2_UseSageTexManager) - size_table[j + i] = type + 5 * (j + i); - else - size_table[j + i] = info.size_index; - pcStates->release_texture(info.id); - } - - gr_free(info.bm); - } - } + return m_psCurrentRS->bFogOn; } -int init_size_tables(int** p_size_list) +BOOL cD6States::GetDitheringState() { - init_size_table(alpha_size_table, TF_RGB); - init_size_table(generic_size_table, 0); - init_size_table(rgb_size_table, TF_ALPHA); - init_size_table(trgb_size_table, TF_ALPHA | TF_RGB); - init_size_table(b8888_size_table, TF_TRANS); - return munge_size_tables(p_size_list); + return m_psCurrentRS->bDitheringOn; } -void InitDefaultTexture(int size) +BOOL cD6States::GetAntialiasingState() { - grs_bitmap* bm; - int i, j; - byte c0, c1; - - bm = gr_alloc_bitmap(2, 0, size, size); + return m_psCurrentRS->bAntialiasingOn; +} - c0 = FindClosestColor(180, 10, 10); - c1 = FindClosestColor(10, 180, 10); +BOOL cD6States::GetTexWrapping(DWORD dwLevel) +{ + return m_psCurrentRS->eWrap[dwLevel] == D3DTADDRESS_WRAP; +} - for (i = 0; i < size; ++i) - { - for (j = 0; j < size; ++j) - { - bm->bits[j + i * size] = ((i + j) & 1) != 0 ? c0 : c1; - } - } +void* cD6States::GetCurrentStates() +{ + return m_psCurrentRS; +} - default_bm = bm; +BOOL cD6States::IsPaletteOn() +{ + return m_psCurrentRS->bUsePalette; } cD6States::cD6States() @@ -411,7 +267,7 @@ int cD6States::Initialize(ulong dwRequestedFlags) EnumerateTextureFormats(); - for (i = 0; i < 256; ++i) + for (i = 0; i < MAX_PALETTES; ++i) { texture_pal_opaque[i] = 0; texture_pal_trans[i] = 0; @@ -461,26 +317,25 @@ void cD6States::EnumerateTextureFormats() m_bTexture_RGB = g_bPrefer_RGB; - g_FormatList[0] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; + g_FormatList[PF_GENERIC] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; - if (!g_FormatList[0]->dwFlags) + if (!g_FormatList[PF_GENERIC]->dwFlags) { m_bTexture_RGB = m_bTexture_RGB == FALSE; - g_FormatList[0] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; - if (!g_FormatList[0]->dwFlags) + g_FormatList[PF_GENERIC] = m_bTexture_RGB ? &g_RGBTextureFormat : &g_PalTextureFormat; + if (!g_FormatList[PF_GENERIC]->dwFlags) CriticalMsg("Direct3D device does not support 8 bit palettized or 15 or 16 bit RGB textures"); } - g_FormatList[1] = &g_RGBTextureFormat; - g_FormatList[2] = &g_AlphaTextureFormat; - g_FormatList[3] = &g_TransRGBTextureFormat; - g_FormatList[4] = &g_8888TexFormat; + g_FormatList[PF_RGB] = &g_RGBTextureFormat; + g_FormatList[PF_ALPHA] = &g_AlphaTextureFormat; + g_FormatList[PF_MASK] = &g_TransRGBTextureFormat; + g_FormatList[PF_RGBA] = &g_8888TexFormat; - if (bSpewOn) - mprintf("Using %s textures\n", m_bTexture_RGB ? "16 bit RGB" : "Palettized"); + mono_printf(("Using %s textures\n", m_bTexture_RGB ? "16 bit RGB" : "Palettized")); - if (!g_AlphaTextureFormat.dwFlags && bSpewOn) - mprintf("no alpha texture format available.\n"); + if (!g_AlphaTextureFormat.dwFlags) + mono_printf(("no alpha texture format available.\n")); memset(&hal, 0, sizeof(hal)); hal.dwSize = sizeof(hal); @@ -492,8 +347,7 @@ void cD6States::EnumerateTextureFormats() CriticalMsg3(pcDXef, "Failed to obtain device caps", (ushort)hr, GetDDErrorMsg(hr)); } - if ((hal.dwFlags & 2) == 0) - CriticalMsg("No HAL device!"); + AssertMsg(hal.dwFlags & D3DDD_DEVCAPS, "No HAL device!"); memset(&ddsd, 0, sizeof(ddsd)); memcpy(&ddsd.ddpfPixelFormat, g_FormatList[0], sizeof(ddsd.ddpfPixelFormat)); @@ -570,12 +424,12 @@ ulong cD6States::GetRenderStatesSize() void cD6States::SetPointerToCurrentStates(char* p) { - this->m_psCurrentRS = (sRenderStates*)p; + m_psCurrentRS = (sRenderStates*)p; } void cD6States::SetPointerToSetStates(char* p) { - this->m_psSetRS = (sRenderStates*)p; + m_psSetRS = (sRenderStates*)p; } void cD6States::SetCommonDefaultStates(ulong dwRequestedFlags, int bMultiTexture) @@ -707,7 +561,7 @@ void cD6States::SetCommonDefaultStates(ulong dwRequestedFlags, int bMultiTexture } else { - DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + Warning((pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR))); } lgd3d_g_bInitialized = 0; } @@ -741,7 +595,7 @@ int cD6States::SetDefaultsStates(ulong dwRequestedFlags) } else { - DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + Warning((pcLGD3Def, LGD3D_EC_VD_MPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_MPASS_MT), (ushort)hR, GetDDErrorMsg(hR))); } lgd3d_g_bInitialized = 0; @@ -763,7 +617,7 @@ int cD6States::SetDefaultsStates(ulong dwRequestedFlags) } else { - DbgReportWarning(pcLGD3Def, LGD3D_EC_VD_S_DEFAULT, GetLgd3dErrorCode(LGD3D_EC_VD_S_DEFAULT), (ushort)hR, GetDDErrorMsg(hR)); + Warning((pcLGD3Def, LGD3D_EC_VD_S_DEFAULT, GetLgd3dErrorCode(LGD3D_EC_VD_S_DEFAULT), (ushort)hR, GetDDErrorMsg(hR))); } lgd3d_g_bInitialized = 0; @@ -802,17 +656,20 @@ void cD6States::end_frame() int cD6States::load_texture(tdrv_texture_info* info) { - ulong local_end, agp_end; - ulong local_start, agp_start; + int n = info->id; + DWORD local_end = 0, agp_end = 0; + DWORD local_start = 0, agp_start = 0; int size; int status; - local_start = 0; - agp_start = 0; + put_mono('a'); + size = info->size_index < 0 ? 0 : m_texture_size_list[info->size_index]; - if ((m_texture_caps & 0x20) != 0 && info->w != info->h) + if ((m_texture_caps & D3DPTEXTURECAPS_SQUAREONLY) && (info->w != info->h)) { + put_mono('.'); return TMGR_FAILURE; + } if (!b_SS2_UseSageTexManager) { @@ -831,15 +688,14 @@ int cD6States::load_texture(tdrv_texture_info* info) return TMGR_FAILURE; } - if (info->id >= LGD3D_MAX_TEXTURES) + if (n >= LGD3D_MAX_TEXTURES) CriticalMsg("Texture id out of range"); status = reload_texture(info); if (status && m_bUsingLocalMem && m_bAGP_available) { - if (bSpewOn) - mprintf("using nonlocal vidmem textures...\n"); + mono_printf(("using nonlocal vidmem textures...\n")); m_bUsingLocalMem = 0; m_DeviceSurfaceCaps = NONLOCAL_CAPS; @@ -872,7 +728,7 @@ int cD6States::load_texture(tdrv_texture_info* info) return TMGR_SUCCESS; } - DbgReportWarning("Texture load took no space!\n"); + Warning(("Texture load took no space!\n")); if (info->w == 1 && info->h == 1) { @@ -882,7 +738,7 @@ int cD6States::load_texture(tdrv_texture_info* info) } else { - DbgReportError(1, "Direct3d device driver does not accurately report texture memory usage.\n Contact your 3d accelerator vendor for updated drivers."); + Error(1, "Direct3d device driver does not accurately report texture memory usage.\n Contact your 3d accelerator vendor for updated drivers."); return TMGR_FAILURE; } } @@ -901,7 +757,7 @@ void cD6States::release_texture(int n) pcRenderBuffer->FlushPrimitives(); if (!psTexData->lpSurface) - DbgReportWarning("texture %i already released\n", n); + Warning(("texture %i already released\n", n)); if (psTexData->lpSurface && m_bLocalMem_available && !m_bUsingLocalMem) { @@ -925,55 +781,58 @@ void cD6States::release_texture(int n) int cD6States::reload_texture(tdrv_texture_info* info) { - IDirectDrawSurface4* SysmemSurface, **pDeviceSurface; - DDSURFACEDESC2 pddsd; + IDirectDrawSurface4* SysmemSurface, ** pDeviceSurface; + DDSURFACEDESC2 ddsd; d3d_cookie cookie; LPDDPIXELFORMAT pixel_format; HRESULT LastError; - IDirect3DTexture2 *SysmemTexture = NULL, **pDeviceTexture; + IDirect3DTexture2* SysmemTexture = NULL, ** pDeviceTexture; + sTextureData* psTexData; - pDeviceTexture = &g_saTextures[info->id].lpTexture; - pDeviceSurface = &g_saTextures[info->id].lpSurface; + psTexData = &g_saTextures[info->id]; + + pDeviceTexture = &psTexData->lpTexture; + pDeviceSurface = &psTexData->lpSurface; cookie.value = info->cookie; - pixel_format = g_FormatList[cookie.flags & (TF_TRANS | TF_ALPHA | TF_RGB)]; - if ((cookie.flags & (TF_TRANS | TF_ALPHA | TF_RGB)) == TF_TRANS && !g_b8888supported) + pixel_format = g_FormatList[cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)]; + if ((cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)) == PF_RGBA && !g_b8888supported) pixel_format = g_FormatList[2]; if (pixel_format->dwFlags == 0) return TMGR_FAILURE; - memset(&pddsd, 0, sizeof(pddsd)); - pddsd.dwSize = sizeof(pddsd); - pddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; - pddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; - pddsd.dwHeight = info->h; - pddsd.dwWidth = info->w; - memcpy(&pddsd.ddpfPixelFormat, pixel_format, sizeof(pddsd.ddpfPixelFormat)); - - LastError = CreateDDSurface(cookie, &pddsd, &SysmemSurface); - CheckHResult(LastError, "CreateSurface() failed"); + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + ddsd.dwHeight = info->h; + ddsd.dwWidth = info->w; + memcpy(&ddsd.ddpfPixelFormat, pixel_format, sizeof(ddsd.ddpfPixelFormat)); + + LastError = CreateDDSurface(cookie, &ddsd, &SysmemSurface); + CheckHResult(LastError, "CreateDDSurface() failed"); AssertMsg(SysmemSurface != NULL, "NULL SysmemSurface"); LastError = SysmemSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)&SysmemTexture); CheckHResult(LastError, "Failed to obtain D3D texture interface for sysmem surface"); - pddsd.dwSize = sizeof(DDSURFACEDESC2); - pddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwSize = sizeof(DDSURFACEDESC2); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; if (*pDeviceTexture == NULL) { IDirectDrawSurface4* DeviceSurface; - pddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; - LastError = CreateDDSurface(cookie, &pddsd, pDeviceSurface); + ddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &ddsd, pDeviceSurface); if ((LastError != DD_OK) && m_bUsingLocalMem && m_bAGP_available) { mono_printf(("using nonlocal vidmem textures...\n")); // try AGP textures... m_bUsingLocalMem = FALSE; m_DeviceSurfaceCaps = NONLOCAL_CAPS; - pddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; - LastError = CreateDDSurface(cookie, &pddsd, pDeviceSurface); + ddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &ddsd, pDeviceSurface); } if (LastError != DD_OK) { @@ -989,22 +848,22 @@ int cD6States::reload_texture(tdrv_texture_info* info) #define MEMORY_TYPE_MASK \ (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM|DDSCAPS_NONLOCALVIDMEM) - if ((m_DeviceSurfaceCaps & MEMORY_TYPE_MASK) != (pddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)) + if ((m_DeviceSurfaceCaps & MEMORY_TYPE_MASK) != (ddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)) mono_printf(( "device texture not created in requested memory location\nRequested %x Received %x\n", - m_DeviceSurfaceCaps & MEMORY_TYPE_MASK, pddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)); + m_DeviceSurfaceCaps & MEMORY_TYPE_MASK, ddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)); // Query our device surface for a texture interface LastError = DeviceSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)pDeviceTexture); CheckHResult(LastError, "Failed to obtain D3D texture interface for device surface."); } - + // Load the bitmap into the sysmem surface - LastError = SysmemSurface->Lock(NULL, &pddsd, 0, NULL); + LastError = SysmemSurface->Lock(NULL, &ddsd, 0, NULL); CheckHResult(LastError, "Failed to lock sysmem surface."); - LoadSurface(info, &pddsd); + LoadSurface(info, &ddsd); LastError = SysmemSurface->Unlock(NULL); CheckHResult(LastError, "Failed to unlock sysmem surface."); @@ -1021,34 +880,2343 @@ int cD6States::reload_texture(tdrv_texture_info* info) SafeRelease(SysmemTexture); SafeRelease(SysmemSurface); - g_saTextures[info->id].pTdrvBitmap = info->bm; - g_saTextures[info->id].TdrvCookie.value = info->cookie; + psTexData->pTdrvBitmap = info->bm; + psTexData->TdrvCookie.value = info->cookie; return TMGR_SUCCESS; } +void cD6States::cook_info(tdrv_texture_info* info) +{ + d3d_cookie cookie; + int v, w = info->w, h = info->h; + + cookie.palette = 0; + + if (gr_get_fill_type() == FILL_BLEND) + { + cookie.flags = PF_ALPHA; + } + else + { + switch (info->bm->type) + { + case BMT_FLAT8: + cookie.palette = info->bm->align; + if (info->bm->flags & BMF_TRANS) + { + if (texture_pal_trans[cookie.palette] != NULL && g_TransRGBTextureFormat.dwFlags != 0 && + (m_psCurrentRS->dwTexBlendMode[0] != FALSE || m_psCurrentRS->nAlphaColor >= 255)) + cookie.flags = PF_MASK; + else + cookie.flags = PF_TRANS; + } + else + { + cookie.flags = PF_GENERIC; + } + break; + case BMT_FLAT16: + if (gr_test_bitmap_format(info->bm, BMF_RGB_4444)) + { + cookie.flags = PF_ALPHA; + } + else if (info->bm->flags & BMF_TRANS) + { + if (g_TransRGBTextureFormat.dwFlags != 0 && (m_psCurrentRS->dwTexBlendMode[0] != FALSE || m_psCurrentRS->nAlphaColor >= 255)) + cookie.flags = PF_MASK; + else + cookie.flags = PF_TRANS | PF_RGB; + } + else + cookie.flags = PF_RGB; + break; + // BMT_TLUC8+1 + case BMT_FLAT32: + cookie.flags = PF_RGBA; + break; + } + } + + calc_size(info, cookie); + + cookie.hlog = 0; + cookie.wlog = 0; + for (v = 2; v <= w; v += v) + { + cookie.wlog++; + } + for (v = 2; v <= h; v += v) + { + cookie.hlog++; + } + + AssertMsg((info->h == (1 << cookie.hlog)) && (info->w == (1 << cookie.wlog)), + "hlog/wlog does not match texture width/height"); + + info->cookie = cookie.value; +} + +// Disconnect texture from bitmap, but don't release texture yet +void cD6States::unload_texture(int n) +{ + AssertMsg((n >= 0) && (n < LGD3D_MAX_TEXTURES), "Texture id out of range"); + g_saTextures[n].pTdrvBitmap = NULL; +} +/***************************************************************************/ +/* Loading a grs_bitmap into a system memory surface */ +/***************************************************************************/ +/* + * LoadSurface + * Loads a grs_bitmap into a texture map DD surface of the given format. The + * memory flag specifies DDSCAPS_SYSTEMMEMORY or DDSCAPS_VIDEOMEMORY. + */ -void GetAvailableTexMem(ulong* local, ulong* agp) +long cD6States::CreateDDSurface(d3d_cookie cookie, DDSURFACEDESC2* pddsd, LPDIRECTDRAWSURFACE4* ppDDS) { - DDSCAPS2 ddscaps; - ulong total; + HRESULT ddrval; + LPDIRECTDRAWSURFACE4 pDDS; + DDCOLORKEY ck; + DWORD ckey; + + ddrval = g_lpDD_ext->CreateSurface(pddsd, ppDDS, NULL); + if (ddrval != DD_OK) + return ddrval; + + pDDS = *ppDDS; + + // Bind the palette, if necessary + if (pddsd->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { + ddrval = pDDS->SetPalette(lpDDPalTexture[cookie.palette]); + CheckHResult(ddrval, "SetPalette failed while creating surface."); + ckey = 0; + } + else + ckey = m_psCurrentRS->chroma_key; + + // Set colorkey, if necessary + if (PF_TRANS & cookie.flags) { + ck.dwColorSpaceLowValue = ckey; + ck.dwColorSpaceHighValue = ckey; + ddrval = pDDS->SetColorKey(DDCKEY_SRCBLT, &ck); + CheckHResult(ddrval, "SetColorKey failed while creating surface."); + } + + return DD_OK; +} + +void cD6States::LoadSurface(tdrv_texture_info* info, DDSURFACEDESC2* ddsd) +{ + grs_bitmap* bm = info->bm; + uchar zero_save = 0; + d3d_cookie cookie; + + cookie.value = info->cookie; + + if ((texture_clut != NULL) && (bm->flags & BMF_TRANS)) + { + zero_save = texture_clut[0]; + texture_clut[0] = 0; + } + + if (ddsd->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { + uchar* dst = (uchar*)ddsd->lpSurface; + if ((info->scale_w | info->scale_h) != 0) + if (texture_clut != NULL) + blit_8to8_clut_scale(info, dst, ddsd->lPitch); + else + blit_8to8_scale(info, dst, ddsd->lPitch); + else + if (texture_clut != NULL) + blit_8to8_clut(info, dst, ddsd->lPitch); + else + blit_8to8(info, dst, ddsd->lPitch); + } + else { + ushort* dst = (ushort*)ddsd->lpSurface; + int drow = ddsd->lPitch / 2; + char type = cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA); + + if (bm->type == BMT_FLAT8) { + ushort* pal; + ushort zero_save; + + pal = texture_pal_list[cookie.flags & PF_MASK][cookie.palette]; + if (pal == NULL) + pal = grd_pal16_list[0]; + + if (cookie.flags & PF_TRANS) { + zero_save = pal[0]; + pal[0] = m_psCurrentRS->chroma_key; + } + + AssertMsg(pal != NULL, "Hey! trying to use NULL 16 bit palette to load texture!"); + + if ((info->scale_w | info->scale_h) != 0) + if ((type & PF_ALPHA) || (texture_clut == NULL)) + blit_8to16_scale(info, dst, drow, pal); + else + blit_8to16_clut_scale(info, dst, drow, pal); + else + if ((type & PF_ALPHA) || (texture_clut == NULL)) + blit_8to16(info, dst, drow, pal); + else if (type == PF_MASK && lgd3d_blend_trans) + blit_8to16_trans(info, dst, drow, pal); + else + blit_8to16_clut(info, dst, drow, pal); + + if (cookie.flags & PF_TRANS) + pal[0] = zero_save; + + } + else if (bm->type == BMT_FLAT32) + { + if (g_b8888supported) + if ((info->scale_w | info->scale_h) != 0) + blit_32to32_scale(info, dst, drow); + else + blit_32to32(info, dst, drow); + else + blit_32to16(info, dst, drow); + + } + else { // assume straight 16 to 16 + if ((info->scale_w | info->scale_h) != 0) + blit_16to16_scale(info, dst, drow); + else + blit_16to16(info, dst, drow); + } + + } + + if (zero_save != 0) + texture_clut[0] = zero_save; +} - if (!g_lpDD_ext) - CriticalMsg("No DirectDraw object!"); - memset(&ddscaps, 0, sizeof(ddscaps)); +void cD6States::release_texture_a(int n) +{ + DDSCAPS2 ddscaps; + sTextureData* psTexData; - if (local) - { - ddscaps.dwCaps = NONLOCAL_CAPS; - g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, local); - } + AssertMsg(n < LGD3D_MAX_TEXTURES, "Texture id out of range"); - if (agp) - { - ddscaps.dwCaps = NONLOCAL_CAPS; - g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, agp); - } + psTexData = &g_saTextures[n]; + + if (n == m_psCurrentRS->naTextureId[0]) + pcRenderBuffer->FlushPrimitives(); + + SafeRelease(psTexData->lpTexture); + SafeRelease(psTexData->lpSurface); + + psTexData->pTdrvBitmap = 0; +} + +int cD6States::load_texture_a(tdrv_texture_info* info) +{ + int n = info->id; + sTextureData* psTexData; + + put_mono('a'); + + if ((m_texture_caps & D3DPTEXTURECAPS_SQUAREONLY) && (info->w != info->h)) { + put_mono('.'); + return TMGR_FAILURE; + } + + AssertMsg(info->id < LGD3D_MAX_TEXTURES, "Texture id out of range"); + + psTexData = &g_saTextures[n]; + + if (n == m_psCurrentRS->naTextureId[0]) + pcRenderBuffer->FlushPrimitives(); + + SafeRelease(psTexData->lpTexture); + SafeRelease(psTexData->lpSurface); + + return reload_texture_a(info); +} + +int cD6States::reload_texture_a(tdrv_texture_info* info) +{ + sTextureData* psTexData; + LPDDPIXELFORMAT pixel_format; + IDirectDrawSurface4* SysmemSurface, ** pDeviceSurface; + HRESULT LastError; + DDSURFACEDESC2 ddsd; + IDirect3DTexture2** pDeviceTexture; + d3d_cookie cookie; + IDirectDrawSurface4* DeviceSurface; + + psTexData = &g_saTextures[info->id]; + pDeviceTexture = &g_saTextures[info->id].lpTexture; + pDeviceSurface = &g_saTextures[info->id].lpSurface; + cookie.value = info->cookie; + + pixel_format = g_FormatList[cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)]; + + if (pixel_format->dwFlags == 0) + return TMGR_FAILURE; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_TEXTURESTAGE | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + ddsd.dwHeight = info->h; + ddsd.dwWidth = info->w; + memcpy(&ddsd.ddpfPixelFormat, pixel_format, sizeof(ddsd.ddpfPixelFormat)); + + LastError = CreateDDSurface(cookie, &ddsd, &SysmemSurface); + CheckHResult(LastError, "CreateDDSurface() failed"); + AssertMsg(SysmemSurface != NULL, "NULL SysmemSurface"); + + if (*pDeviceTexture == NULL) { + + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + ddsd.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE; + ddsd.dwTextureStage = (cookie.flags & PF_STAGE); + LastError = CreateDDSurface(cookie, &ddsd, pDeviceSurface); + CheckHResult(LastError, "CreateDDSurface() failed"); + AssertMsg(SysmemSurface != NULL, "NULL SysmemSurface"); + + DeviceSurface = *pDeviceSurface; + + // Query our device surface for a texture interface + LastError = DeviceSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)pDeviceTexture); + CheckHResult(LastError, "Failed to obtain D3D texture interface for device surface."); + } + + // Load the bitmap into the sysmem surface + LastError = SysmemSurface->Lock(NULL, &ddsd, 0, NULL); + CheckHResult(LastError, "Failed to lock sysmem surface."); + + LoadSurface(info, &ddsd); + + LastError = SysmemSurface->Unlock(NULL); + CheckHResult(LastError, "Failed to unlock sysmem surface."); + + LastError = DeviceSurface->Blt(NULL, SysmemSurface, NULL, DDBLT_WAIT, NULL); + CheckHResult(LastError, "Failed to blit sysmem surface."); + + SafeRelease(SysmemSurface); + + psTexData->pTdrvBitmap = info->bm; + psTexData->TdrvCookie.value = info->cookie; + + return TMGR_SUCCESS; +} + +int cD6States::get_texture_id() +{ + return m_psCurrentRS->naTextureId[0]; +} + +void cD6States::TurnOffTexuring(BOOL bTexOff) +{ + HRESULT hResult; + + if (!bTexOff) + { + SetTextureNow(); + return; + } + + hResult = g_lpD3Ddevice->SetTexture(0, NULL); + CheckHResult(hResult, "SetTexture failed"); + m_psSetRS->naTextureId[0] = TMGR_ID_SOLID; + g_bTexSuspended = TRUE; } +void cD6States::SetDithering(BOOL bOn) +{ + HRESULT hRes; + + if (!m_bCanDither) + return; + + m_psCurrentRS->bDitheringOn = bOn; + + if (m_psSetRS->bDitheringOn != m_psCurrentRS->bDitheringOn) + { + pcRenderBuffer->FlushPrimitives(); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DITHERENABLE, m_psCurrentRS->bDitheringOn); + m_psSetRS->bDitheringOn = m_psCurrentRS->bDitheringOn; + } +} + +void cD6States::SetAntialiasing(BOOL bOn) +{ + HRESULT hRes; + + if (!m_bCanAntialias) + return; + + m_psCurrentRS->bAntialiasingOn = bOn; + + if (m_psSetRS->bAntialiasingOn != m_psCurrentRS->bAntialiasingOn) + { + pcRenderBuffer->FlushPrimitives(); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ANTIALIAS, m_psCurrentRS->bAntialiasingOn != 0 ? D3DANTIALIAS_SORTINDEPENDENT : D3DANTIALIAS_NONE); + m_psSetRS->bAntialiasingOn = m_psCurrentRS->bAntialiasingOn; + } +} + +void cD6States::EnableDepthBuffer(int nFlag) +{ + HRESULT hRes; + + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->eZenable = (D3DZBUFFERTYPE)nFlag; + m_psSetRS->eZenable = (D3DZBUFFERTYPE)nFlag; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZENABLE, m_psCurrentRS->eZenable); +} + +void cD6States::SetZWrite(BOOL bZWriteOn) +{ + HRESULT hRes; + + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->bZWriteEnable = bZWriteOn; + m_psSetRS->bZWriteEnable = bZWriteOn; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZWRITEENABLE, m_psCurrentRS->bZWriteEnable); +} + +void cD6States::SetZCompare(BOOL bZCompreOn) +{ + HRESULT hRes; + + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->eZCompareFunc = bZCompreOn ? D3DCMP_LESSEQUAL : D3DCMP_ALWAYS; + m_psSetRS->eZCompareFunc = m_psCurrentRS->eZCompareFunc; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ZFUNC, m_psCurrentRS->eZCompareFunc); +} + +void cD6States::SetFogDensity(float fDensity) +{ + HRESULT hRes; + + if (!g_bUseTableFog && !g_bUseVertexFog) + return; + + pcRenderBuffer->FlushPrimitives(); + + if (!g_bWFog) + fDensity = fDensity * (0.5 * z_far); + + m_psCurrentRS->fFogTableDensity = fDensity; + m_psSetRS->fFogTableDensity = fDensity; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLEDENSITY, m_psCurrentRS->fFogTableDensity); +} + +BOOL cD6States::UseLinearTableFog(BOOL bOn) +{ + HRESULT hRes; + BOOL bWas; + + if (!g_bUseTableFog) + return FALSE; + + bWas = m_psCurrentRS->eFogMode == D3DFOG_LINEAR; + + if (bWas == bOn) + return bWas; + + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->eFogMode = bOn != FALSE ? D3DFOG_LINEAR : D3DFOG_EXP; + m_psSetRS->eFogMode = m_psCurrentRS->eFogMode; + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLEMODE, m_psCurrentRS->eFogMode); +} + +float cD6States::LinearWorldIntoFogCoef(float fLin) +{ + if (g_bWFog) + return fLin; + + AssertMsg(z_far > z_near, "Z far and near values are incorrect"); + + return (z_far - z_far * z_near / fLin) / (z_far - z_near); +} + +void cD6States::SetFogStartAndEnd(float fStart, float fEnd) +{ + HRESULT hRes; + float fScaledStart, fScaledEnd; + + if (!g_bUseTableFog) + return; + + fScaledStart = LinearWorldIntoFogCoef(fStart); + fScaledEnd = LinearWorldIntoFogCoef(fEnd); + + m_psCurrentRS->fFogStart = fScaledStart; + m_psSetRS->fFogStart = fScaledStart; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLESTART, m_psCurrentRS->fFogStart); + + m_psCurrentRS->fFogEnd = fScaledEnd; + m_psSetRS->fFogEnd = fScaledEnd; + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGTABLEEND, m_psCurrentRS->fFogEnd); +} + +void cD6States::SetLinearFogDistance(float fDistance) +{ + float fStart, fEnd; + + if (g_bWFog) + return SetFogStartAndEnd(1.0, fDistance); + + fEnd = fDistance > z_far ? z_far : fDistance; + fStart = fDistance >= z_near ? (fDistance - z_near) * 0.2 + z_near : z_near; + + SetFogStartAndEnd(fStart, fEnd); +} + +void cD6States::SetAlphaColor(float fAlpha) +{ + // convert to integral and clamp + int iNewValue = int(fAlpha * 255.0); + if (iNewValue > 255) iNewValue = 255; + if (iNewValue < 0) iNewValue = 0; + + if (m_psCurrentRS->nAlphaColor != iNewValue) + { + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->nAlphaColor = iNewValue; + m_psSetRS->nAlphaColor = iNewValue; + pcRenderBuffer->PassAlphaColor(iNewValue); + } +} + +void cD6States::EnableAlphaBlending(BOOL bAlphaOn) +{ + HRESULT hRes; + if (bAlphaOn == m_psCurrentRS->bAlphaOn && bAlphaOn == m_psSetRS->bAlphaOn) + return; + + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->bAlphaOn = bAlphaOn; + m_psSetRS->bAlphaOn = bAlphaOn; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); +} + +void cD6States::SetAlphaModulateHack(int iBlendMode) +{ + HRESULT hRes; + pcRenderBuffer->FlushPrimitives(); + + // and 3 <=> mod 4 + m_psCurrentRS->eSrcAlpha = table[iBlendMode & 3]; + m_psSetRS->eSrcAlpha = m_psCurrentRS->eSrcAlpha; + m_psCurrentRS->eDstAlpha = table[(iBlendMode >> 2) & 3]; + m_psSetRS->eDstAlpha = m_psCurrentRS->eDstAlpha; + + if (!lgd3d_punt_d3d) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SRCBLEND, m_psCurrentRS->eSrcAlpha); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DESTBLEND, m_psCurrentRS->eDstAlpha); + } +} + +void cD6States::ResetDefaultAlphaModulate() +{ + HRESULT hRes; + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->eSrcAlpha = D3DBLEND_SRCALPHA; + m_psSetRS->eSrcAlpha = D3DBLEND_SRCALPHA; + m_psCurrentRS->eDstAlpha = D3DBLEND_INVSRCALPHA; + m_psSetRS->eDstAlpha = D3DBLEND_INVSRCALPHA; + + if (!lgd3d_punt_d3d) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SRCBLEND, m_psCurrentRS->eSrcAlpha); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DESTBLEND, m_psCurrentRS->eDstAlpha); + } +} + +void cD6States::SetTextureMapMode(DWORD dwFlag) +{ + DWORD dwFilteredFlag; + + if (dwFlag >= LGD3DTB_NO_STATES) + { + Warning(("cD6States::SetTextureMapMode(): mode %i out of range.\n", dwFlag)); + return; + } + + if (dwFlag == LGD3DTB_MODULATE) + dwFilteredFlag = m_bCanModulate == FALSE; + else + { + if (dwFlag == LGD3DTB_MODULATEALPHA) + { + if (m_bCanModulateAlpha) + dwFilteredFlag = dwFlag; + else + dwFilteredFlag = FALSE; + } + else + dwFilteredFlag = dwFlag; + } + + m_psCurrentRS->dwTexBlendMode[0] = dwFilteredFlag; +} + +void cD6States::GetTexBlendingModes(DWORD* pdw0LevelMode, DWORD* pdw1LevelMode) +{ + if (pdw0LevelMode) + *pdw0LevelMode = m_psCurrentRS->dwTexBlendMode[0]; + if (pdw1LevelMode) + *pdw1LevelMode = m_psCurrentRS->dwTexBlendMode[1]; +} + +BOOL cD6States::SetSmoothShading(BOOL bSmoothOn) +{ + HRESULT hRes; + BOOL bWasSmooth = IsSmoothShadingOn(); + + if (bSmoothOn == bWasSmooth) + return bWasSmooth; + + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->eShadeMode = D3DSHADEMODE(int(bSmoothOn != FALSE) + D3DSHADE_FLAT); + m_psSetRS->eShadeMode = m_psCurrentRS->eShadeMode; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SHADEMODE, m_psCurrentRS->eShadeMode); +} + +void cD6States::EnableFog(BOOL bFogOn) +{ + HRESULT hRes; + if (!g_bUseTableFog && !g_bUseVertexFog) + return; + + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->bFogOn = bFogOn; + m_psSetRS->bFogOn = bFogOn; + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGENABLE, m_psCurrentRS->bFogOn); +} + +void cD6States::SetFogSpecularLevel(float fLevel) +{ + D3DCOLOR dsNewColor = D3DRGBA(0.0, 0.0, 0.0, 1.0 - fLevel); + + if (m_psCurrentRS->dcFogSpecular == dsNewColor) + return; + + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->dcFogSpecular = dsNewColor; + m_psSetRS->dcFogSpecular = dsNewColor; + pcRenderBuffer->PassFogSpecularColor(m_psCurrentRS->dcFogSpecular); +} + +void cD6States::SetFogColor(int r, int g, int b) +{ + int hRes; + if (!g_bUseTableFog && !g_bUseVertexFog) + return; + + if (r > 255) + r = 255; + else if (r < 0) + r = 0; + if (g > 255) + g = 255; + else if (g < 0) + g = 0; + if (b > 255) + b = 255; + else if (b < 0) + b = 0; + + m_psCurrentRS->dwFogColor = RGB_MAKE(r, g, b); + m_psSetRS->dwFogColor = m_psCurrentRS->dwFogColor; + + if (!lgd3d_punt_d3d) + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_FOGCOLOR, m_psCurrentRS->dwFogColor); +} + +DWORD cD6States::get_color() +{ + D3DCOLOR color; + int lgd3d_alpha = m_psCurrentRS->nAlphaColor; + + if (m_psCurrentRS->bUsePalette) { + int index = grd_gc.fcolor & 0xff; + + switch (grd_gc.fill_type) { + default: + Warning(("lgd3d: unsupported fill type: %i\n", grd_gc.fill_type)); + case FILL_NORM: + break; + case FILL_CLUT: + index = ((uchar*)grd_gc.fill_parm)[index]; + break; + case FILL_SOLID: + index = grd_gc.fill_parm; + } + + // This hack effectively simulates the lighting table + // hacks done in flight2 + if (lgd3d_clut != NULL) + index = lgd3d_clut[index]; + + index *= 3; + color = RGBA_MAKE(grd_pal[index], grd_pal[index + 1], grd_pal[index + 2], lgd3d_alpha); + } + else { + switch (grd_gc.fill_type) { + default: + Warning(("lgd3d: unsupported fill type: %i\n", grd_gc.fill_type)); + case FILL_NORM: + color = grd_gc.fcolor; + break; + case FILL_SOLID: + color = grd_gc.fill_parm; + } + color = (color & 0xffffff) + (lgd3d_alpha << 24); + } + + return color; +} + +void cD6States::SetTextureNow() +{ + HRESULT hResult; + g_bTexSuspended = FALSE; + hResult = g_lpD3Ddevice->SetTexture(0, g_saTextures[m_psCurrentRS->naTextureId[0]].lpTexture); + CheckHResult(hResult, "SetTexture failed"); +} + +void cD6States::set_texture_id(int n) +{ + HRESULT hRes, hResult; + uint8 pixel_flags; + + if (lgd3d_punt_d3d) + return; + + m_psCurrentRS->naTextureId[0] = n; + + // if current texture already selected + if (m_psSetRS->naTextureId[0] == m_psCurrentRS->naTextureId[0]) + { + // update alpha blending mode only + if (m_psCurrentRS->baTextureWithAlpha[0] && !m_psSetRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + m_psSetRS->bAlphaOn = TRUE; + } + else if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + else + { + // otherwise, draw the batch and recheck all depend options + pcRenderBuffer->FlushPrimitives(); + + if (m_psCurrentRS->naTextureId[0] == TMGR_ID_CALLBACK) + { + g_tmgr->set_texture_callback(); + } + else + { + if (m_psCurrentRS->naTextureId[0] == TMGR_ID_SOLID) + { + hResult = g_lpD3Ddevice->SetTexture(0, NULL); + CheckHResult(hResult, "SetTexture failed"); + + m_psSetRS->naTextureId[0] = TMGR_ID_SOLID; + + if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + else // where is TDRV_ID_INVALID check??? + { + AssertMsg1(m_psCurrentRS->naTextureId[0] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[0]); + pixel_flags = g_saTextures[m_psCurrentRS->naTextureId[0]].TdrvCookie.flags; + m_psCurrentRS->baChromaKeying[0] = (pixel_flags & PF_TRANS) != 0; + + m_psCurrentRS->eMagTexFilter = m_psCurrentRS->eMinTexFilter = m_psCurrentRS->baChromaKeying[0] ? D3DTFN_POINT : D3DTFN_LINEAR; + + if (m_psSetRS->baChromaKeying[0] != m_psCurrentRS->baChromaKeying[0]) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_COLORKEYENABLE, m_psCurrentRS->baChromaKeying[0]); + m_psSetRS->baChromaKeying[0] = m_psCurrentRS->baChromaKeying[0]; + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MAGFILTER, m_psCurrentRS->eMagTexFilter); + m_psSetRS->eMagTexFilter = m_psCurrentRS->eMagTexFilter; + // @SH_NOTE: original error, must be D3DTSS_MINFILTER + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MAGFILTER, m_psCurrentRS->eMinTexFilter); + m_psSetRS->eMinTexFilter = m_psCurrentRS->eMinTexFilter; + } + + m_psCurrentRS->baTextureWithAlpha[0] = (pixel_flags & (PF_RGBA | PF_MASK)) == PF_ALPHA || (pixel_flags & (PF_RGBA | PF_MASK)) == PF_MASK || (pixel_flags & (PF_RGBA | PF_MASK)) == PF_RGBA; + + if (m_psCurrentRS->baTextureWithAlpha[0] && !m_psSetRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + m_psSetRS->bAlphaOn = TRUE; + } + else if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + + if (m_psSetRS->dwTexBlendMode[0] != m_psCurrentRS->dwTexBlendMode[0] || m_psSetRS->baTextureWithAlpha[0] != m_psCurrentRS->baTextureWithAlpha[0]) + { + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[m_psCurrentRS->dwTexBlendMode[0]], sizeof(sTexBlendArgs)); + + if (!m_psCurrentRS->dwTexBlendMode[0] && m_psCurrentRS->baTextureWithAlpha[0]) + m_psCurrentRS->saTexBlend[0].eAlphaOperation = D3DTOP_SELECTARG1; + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + + m_psSetRS->saTexBlend[0] = m_psCurrentRS->saTexBlend[0]; + m_psSetRS->dwTexBlendMode[0] = m_psCurrentRS->dwTexBlendMode[0]; + m_psSetRS->baTextureWithAlpha[0] = m_psCurrentRS->baTextureWithAlpha[0]; + } + + SetTextureNow(); + } + + m_psSetRS->naTextureId[0] = m_psCurrentRS->naTextureId[0]; + } + } +} + +void cD6States::EnablePalette(BOOL bPalOn) +{ + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->bUsePalette = bPalOn; +} + +void cD6States::SetPalSlotFlags(int start, int n, uint8* pal_data, int slot, char flags) +{ + int i; + grs_rgb_bitmask bitmask; + + if (g_lpDD_ext == NULL) + return; + + if (flags & BMF_TLUC8) + { + lgd3d_get_trans_texture_bitmask(&bitmask); + + if (bitmask.red != 0) + { + if (texture_pal_trans[slot] == NULL) + texture_pal_trans[slot] = (ushort*)gr_malloc(512); + + lgd3d_get_trans_texture_bitmask(&bitmask); + gr_make_pal16(start, n, texture_pal_trans[slot], pal_data, &bitmask); + + + } + } + + if (flags & BMF_TRANS || ((flags & BMF_TLUC8) && bitmask.red == 0)) + { + if (m_bTexture_RGB) + { + if (texture_pal_opaque[slot] == NULL) + texture_pal_opaque[slot] = (ushort*)gr_malloc(512); + + lgd3d_get_opaque_texture_bitmask(&bitmask); + gr_make_pal16(start, n, texture_pal_opaque[slot], pal_data, &bitmask); + } + else + SetTexturePalette(start, n, pal_data, slot); + } +} + +void cD6States::SetTexturePalette(int start, int n, uchar* pal, int slot) +{ + PALETTEENTRY peColorTable[256]; + HRESULT hRes; + int i; + + if (lpDDPalTexture[slot] == NULL) + { + hRes = g_lpDD_ext->CreatePalette(DDPCAPS_8BIT | DDPCAPS_ALLOW256, + peColorTable, + &lpDDPalTexture[slot], + NULL); + CheckHResult(hRes, "CreatePalette failed."); + } + + for (i = 0; i < n; i++) { + peColorTable[i].peFlags = D3DPAL_READONLY | PC_RESERVED; + peColorTable[i].peRed = pal[3 * i]; + peColorTable[i].peGreen = pal[3 * i + 1]; + peColorTable[i].peBlue = pal[3 * i + 2]; + } + + hRes = lpDDPalTexture[slot]->SetEntries(0, start, n, peColorTable); + + CheckHResult(hRes, "SetEntries failed."); +} + +void cD6States::SetAlphaPalette(ushort* pal) +{ + pcRenderBuffer->FlushPrimitives(); + alpha_pal = pal; +} + +void cD6States::SetChromaKey(int r, int g, int b) +{ + pcRenderBuffer->FlushPrimitives(); + + m_psCurrentRS->chroma_r = r; + m_psCurrentRS->chroma_g = g; + m_psCurrentRS->chroma_b = b; + if (g_RGBTextureFormat.dwRBitMask == 0x1f) { + // swap red and blue + r = m_psCurrentRS->chroma_b; + b = m_psCurrentRS->chroma_r; + } + m_psCurrentRS->chroma_key = b >> 3; + if (g_RGBTextureFormat.dwGBitMask == GBitMask15) { + m_psCurrentRS->chroma_key += ((g >> 3) << 5) + ((r >> 3) << 10); + } + else { + m_psCurrentRS->chroma_key += ((g >> 2) << 5) + ((r >> 3) << 11); + } +} + +BOOL cD6States::SetTexWrapping(DWORD dwLevel, BOOL bSetSmooth) +{ + HRESULT hResult; + BOOL bWasSmooth = GetTexWrapping(dwLevel); + + if (bWasSmooth == bSetSmooth) + return bWasSmooth; + + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->eWrap[dwLevel] = bSetSmooth != 0 ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP; + m_psSetRS->eWrap[dwLevel] = m_psCurrentRS->eWrap[dwLevel]; + if (!lgd3d_punt_d3d) + SetTextureStageStateForGlobal(g_lpD3Ddevice, dwLevel, D3DTSS_ADDRESS, m_psCurrentRS->eWrap[dwLevel]); + + return bWasSmooth; +} + +BOOL cD6States::EnableSpecular(BOOL bUseIt) +{ + HRESULT hRes; + + BOOL bWas = m_bSpecular; + m_bSpecular = bUseIt; + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SPECULARENABLE, m_bSpecular); + + return bWas; +} + + +cD6States* cImStates::Instance() +{ + if (m_Instance == NULL) + m_Instance = new cImStates; + + return m_Instance; +} + +cD6States* cImStates::DeInstance() +{ + if (m_Instance != NULL) + { + delete m_Instance; + m_Instance = NULL; + } + + return m_Instance; +} + +cImStates::cImStates() +{ + // @SH_NOTE: was parent ctr + // cD6States::cD6States(); +} + +cImStates::~cImStates() +{ + sTextureData* psTD; + IWinDisplayDevice* pWinDisplayDevice; + int i; + + if (m_bTextureListInitialized) + { + if (g_tmgr != NULL) + { + g_tmgr->shutdown(); + g_tmgr = 0; + } + pWinDisplayDevice = AppGetObj(IWinDisplayDevice); + pWinDisplayDevice->RemoveTaskSwitchCallback(callback_id); + if (pWinDisplayDevice) + pWinDisplayDevice->Release(); + + for (i = 0; i < LGD3D_MAX_TEXTURES; i++) + { + psTD = &g_saTextures[i]; + SafeRelease(psTD->lpTexture); + SafeRelease(psTD->lpSurface); + } + m_bTextureListInitialized = FALSE; + } + + if (default_bm) + { + gr_free(default_bm); + default_bm = NULL; + } + + for (i = 0; i < MAX_PALETTES; i++) + { + if (texture_pal_opaque[i]) + { + gr_free(texture_pal_opaque[i]); + texture_pal_opaque[i] = NULL; + } + + if (texture_pal_trans[i]) + { + gr_free(texture_pal_trans[i]); + texture_pal_trans[i] = NULL; + } + + SafeRelease(lpDDPalTexture[i]); + } + + if (m_texture_size_list) + { + free(munge_size_tables); + m_texture_size_list = NULL; + } +} + +cD6States* cMSStates::Instance() +{ + if (m_Instance == NULL) + m_Instance = new cMSStates; + + return m_Instance; +} + +cD6States* cMSStates::DeInstance() +{ + if (m_Instance != NULL) + { + delete m_Instance; + m_Instance = NULL; + } + + return m_Instance; +} + +cMSStates::cMSStates() +{ + // @SH_NOTE: was parent ctr + // cD6States::cD6States(); + m_dwCurrentTexLevel = 0; + m_bTexturePending = 0; +} + +cMSStates::~cMSStates() +{ + sTextureData* psTD; + IWinDisplayDevice* pWinDisplayDevice; + int i; + + if (m_bTextureListInitialized) + { + if (g_tmgr != NULL) + { + g_tmgr->shutdown(); + g_tmgr = 0; + } + pWinDisplayDevice = AppGetObj(IWinDisplayDevice); + pWinDisplayDevice->RemoveTaskSwitchCallback(callback_id); + if (pWinDisplayDevice) + pWinDisplayDevice->Release(); + + for (i = 0; i < LGD3D_MAX_TEXTURES; i++) + { + psTD = &g_saTextures[i]; + SafeRelease(psTD->lpTexture); + SafeRelease(psTD->lpSurface); + } + m_bTextureListInitialized = FALSE; + } + + if (default_bm) + { + gr_free(default_bm); + default_bm = NULL; + } + + for (i = 0; i < MAX_PALETTES; i++) + { + if (texture_pal_opaque[i]) + { + gr_free(texture_pal_opaque[i]); + texture_pal_opaque[i] = NULL; + } + + if (texture_pal_trans[i]) + { + gr_free(texture_pal_trans[i]); + texture_pal_trans[i] = NULL; + } + + SafeRelease(lpDDPalTexture[i]); + } + + if (m_texture_size_list) + { + free(munge_size_tables); + m_texture_size_list = NULL; + } +} + +int cMSStates::Initialize(DWORD dwRequestedFlags) +{ + g_bPrefer_RGB = TRUE; + return cD6States::Initialize(dwRequestedFlags); +} + +BOOL cMSStates::SetDefaultsStates(DWORD dwRequestedFlags) +{ + HRESULT hRes, hResult, hR; + ulong dwPasses; + + SetCommonDefaultStates(dwRequestedFlags, TRUE); + + m_psCurrentRS->eSrcAlpha = D3DBLEND_SRCALPHA; + m_psCurrentRS->eDstAlpha = D3DBLEND_INVSRCALPHA; + m_psCurrentRS->bAlphaOn = FALSE; + + + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_SRCBLEND, m_psCurrentRS->eSrcAlpha); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_DESTBLEND, m_psCurrentRS->eDstAlpha); + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_MAGFILTER, m_psCurrentRS->eMagTexFilter); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_MINFILTER, m_psCurrentRS->eMinTexFilter); + + m_psCurrentRS->eWrap[1] = D3DTADDRESS_WRAP; + // @SH_NOTE: original error, last arg must be m_psCurrentRS->eWrap[1] + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_ADDRESS, m_psCurrentRS->eWrap[0]); + + AssertMsg(dwRequestedFlags & LGD3DF_MULTI_TEXTURING, "Error 666"); + + if ((dwRequestedFlags & LGD3DF_MULTITEXTURE_COLOR) != 0) + { + memcpy(m_psCurrentRS->saTexBlend, sMultiTexBlendArgsProtos[0], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + + if (hR = g_lpD3Ddevice->ValidateDevice(&dwPasses), hR != S_OK) + { + SetLGD3DErrorCode(LGD3D_EC_VD_SPASS_MT, hR); + if (bSpewOn) + { + CriticalMsg4(pcLGD3Def, LGD3D_EC_VD_SPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_SPASS_MT), (ushort)hR, GetDDErrorMsg(hR)); + } + else + { + Warning((pcLGD3Def, LGD3D_EC_VD_SPASS_MT, GetLgd3dErrorCode(LGD3D_EC_VD_SPASS_MT), (ushort)hR, GetDDErrorMsg(hR))); + } + lgd3d_g_bInitialized = FALSE; + + return FALSE; + } + } + + if (dwRequestedFlags & LGD3DF_MT_BLENDDIFFUSE) + { + memcpy(m_psCurrentRS->saTexBlend, sMultiTexBlendArgsProtos[2], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + + if (hR = g_lpD3Ddevice->ValidateDevice(&dwPasses), hR != S_OK) + return FALSE; + + m_psCurrentRS->dwTexBlendMode[1] = LGD3DTB_BLENDDIFFUSE; + } + + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[m_psCurrentRS->dwTexBlendMode[1]], sizeof(m_psCurrentRS->saTexBlend)); + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + + memcpy(m_psSetRS, m_psCurrentRS, sizeof(sRenderStates)); + + g_dwRSChangeFlags = 0; + + return TRUE; +} + +void cMSStates::set_texture_id(int n) +{ + m_bTexturePending = TRUE; + + if (m_psSetRS->naTextureId[m_dwCurrentTexLevel] == n) + { + m_psCurrentRS->naTextureId[m_dwCurrentTexLevel] = n; + } + else + { + pcRenderBuffer->FlushPrimitives(); + m_psCurrentRS->naTextureId[m_dwCurrentTexLevel] = n; + // TODO: find definition to number + if (m_dwCurrentTexLevel == 1) + m_LastLightMapBm = g_saTextures[n].pTdrvBitmap; + + if (m_psCurrentRS->naTextureId[m_dwCurrentTexLevel] == TMGR_ID_CALLBACK) + g_tmgr->set_texture_callback(); + } +} + +int cMSStates::EnableMTMode(DWORD dwMTOn) +{ + HRESULT hResult, hRes, hR; + DWORD dwLevel; + sTexBlendArgs(*sTexArgs)[2]; + BOOL bSetTexture; + DWORD dwNoLMLevels; + sTextureData* psTD; + uint8 pixel_flags; + + if (!m_bTexturePending) + { + if (m_psCurrentRS->naTextureId[0] != -1) + { + if ((m_psCurrentRS->baTextureWithAlpha[0] || m_psCurrentRS->baTextureWithAlpha[1]) && (!m_psSetRS->bAlphaOn)) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + m_psSetRS->bAlphaOn = TRUE; + } + else if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + + return TRUE; + } + + m_bTexturePending = FALSE; + if (dwMTOn) + { + dwNoLMLevels = TRUE; + sTexArgs = sMultiTexBlendArgsProtos; + } + else + { + dwNoLMLevels = FALSE; + sTexArgs = sTexBlendArgsProtos; + } + + m_psCurrentRS->dwNoLightMapLevels = dwNoLMLevels; + bSetTexture = FALSE; + + if (dwMTOn) + { + if (m_psCurrentRS->naTextureId[0] == -1) + { + Warning(("\nMulti texturing with no textures?!\n\n")); + return FALSE; + } + + if (m_psCurrentRS->naTextureId[1] == -1) + { + lgd3d_set_texture_level(1); + if (g_tmgr) + g_tmgr->set_texture(m_LastLightMapBm); + lgd3d_set_texture_level(0); + Warning(("\nSwap-out inside texure pair!, Trying to reload bitmap %p\n\n", m_LastLightMapBm)); + } + + if (m_psSetRS->naTextureId[0] != m_psCurrentRS->naTextureId[0] || m_psSetRS->naTextureId[1] != m_psCurrentRS->naTextureId[1]) + { + bSetTexture = TRUE; + for (dwLevel = 0; dwLevel < 2; dwLevel++) + { + if (m_psSetRS->naTextureId[dwLevel] != m_psCurrentRS->naTextureId[dwLevel]) + { + AssertMsg1(m_psCurrentRS->naTextureId[dwLevel] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[dwLevel]); + m_psCurrentRS->baChromaKeying[dwLevel] = (g_saTextures[m_psCurrentRS->naTextureId[dwLevel]].TdrvCookie.flags & PF_TRANS) != 0; + + if (m_psSetRS->baChromaKeying[dwLevel] != m_psCurrentRS->baChromaKeying[dwLevel]) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_COLORKEYENABLE, m_psCurrentRS->baChromaKeying[dwLevel]); + m_psSetRS->baChromaKeying[dwLevel] = m_psCurrentRS->baChromaKeying[dwLevel]; + } + } + } + } + + if (m_psSetRS->dwNoLightMapLevels != m_psCurrentRS->dwNoLightMapLevels || m_psSetRS->dwTexBlendMode[0] != m_psCurrentRS->dwTexBlendMode[0]) + { + bSetTexture = TRUE; + memcpy(m_psCurrentRS->saTexBlend, sTexArgs[m_psCurrentRS->dwTexBlendMode[dwNoLMLevels]], sizeof(m_psCurrentRS->saTexBlend)); + m_psSetRS->saTexBlend[0] = m_psCurrentRS->saTexBlend[0]; + m_psSetRS->saTexBlend[1] = m_psCurrentRS->saTexBlend[1]; + } + + if (bSetTexture) + { + if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + + AssertMsg1(m_psCurrentRS->naTextureId[0] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[0]); + psTD = &g_saTextures[m_psCurrentRS->naTextureId[0]]; + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + if (hR = g_lpD3Ddevice->SetTexture(0, psTD->lpTexture), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[0] = m_psCurrentRS->naTextureId[0]; + + AssertMsg1(m_psCurrentRS->naTextureId[1] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[1]); + psTD = &g_saTextures[m_psCurrentRS->naTextureId[1]]; + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + if (hR = g_lpD3Ddevice->SetTexture(1, psTD->lpTexture), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[1] = m_psCurrentRS->naTextureId[1]; + + m_psSetRS->dwNoLightMapLevels = m_psCurrentRS->dwNoLightMapLevels; + } + } + else + { + if (m_psSetRS->naTextureId[0] == m_psCurrentRS->naTextureId[0]) + { + if (m_psCurrentRS->baTextureWithAlpha[0] && !m_psSetRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + m_psSetRS->bAlphaOn = TRUE; + } + else if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + else if (m_psCurrentRS->naTextureId[0] == -1) + { + if (hR = g_lpD3Ddevice->SetTexture(0, NULL), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[0] = -1; + m_psCurrentRS->baTextureWithAlpha[0] = FALSE; + if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + else + { + bSetTexture = TRUE; + AssertMsg1(m_psCurrentRS->naTextureId[0] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[0]); + pixel_flags = g_saTextures[m_psCurrentRS->naTextureId[0]].TdrvCookie.flags; + + m_psCurrentRS->baChromaKeying[0] = (pixel_flags & PF_TRANS) != 0; + m_psCurrentRS->eMagTexFilter = m_psCurrentRS->eMinTexFilter = m_psCurrentRS->baChromaKeying[0] ? D3DTFN_POINT : D3DTFN_LINEAR; + + if (m_psSetRS->baChromaKeying[0] != m_psCurrentRS->baChromaKeying[0]) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_COLORKEYENABLE, m_psCurrentRS->baChromaKeying[0]); + m_psSetRS->baChromaKeying[0] = m_psCurrentRS->baChromaKeying[0]; + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MAGFILTER, m_psCurrentRS->eMagTexFilter); + m_psSetRS->eMagTexFilter = m_psCurrentRS->eMagTexFilter; + // @SH_NOTE: second arg must be D3DTSS_MINFILTER + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_MAGFILTER, m_psCurrentRS->eMinTexFilter); + m_psSetRS->eMinTexFilter = m_psCurrentRS->eMinTexFilter; + } + + pixel_flags &= (PF_RGBA | PF_MASK); + m_psCurrentRS->baTextureWithAlpha[0] = pixel_flags == PF_ALPHA || pixel_flags == PF_MASK || pixel_flags == PF_RGBA; + + if (m_psCurrentRS->baTextureWithAlpha[0] && !m_psSetRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); + m_psSetRS->bAlphaOn = TRUE; + } + else if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + } + + if (m_psSetRS->dwNoLightMapLevels != m_psCurrentRS->dwNoLightMapLevels || m_psSetRS->dwTexBlendMode[0] != m_psCurrentRS->dwTexBlendMode[0] || m_psSetRS->baTextureWithAlpha[0] != m_psCurrentRS->baTextureWithAlpha[0]) + { + bSetTexture = TRUE; + memcpy(m_psCurrentRS->saTexBlend, sTexArgs[m_psCurrentRS->dwTexBlendMode[dwNoLMLevels]], sizeof(m_psCurrentRS->saTexBlend)); + if (!m_psCurrentRS->dwTexBlendMode[0] && m_psCurrentRS->baTextureWithAlpha[0]) + m_psCurrentRS->saTexBlend[0].eAlphaOperation = D3DTOP_SELECTARG1; + m_psSetRS->saTexBlend[1] = m_psCurrentRS->saTexBlend[1]; + m_psSetRS->baTextureWithAlpha[0] = m_psCurrentRS->baTextureWithAlpha[0]; + } + + if (bSetTexture) + { + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + + m_psSetRS->dwNoLightMapLevels = m_psCurrentRS->dwNoLightMapLevels; + + if (m_psCurrentRS->naTextureId[0] != -1) + { + AssertMsg1(m_psCurrentRS->naTextureId[0] < LGD3D_MAX_TEXTURES, "Invalid texture id: %i", m_psCurrentRS->naTextureId[0]); + if (hR = g_lpD3Ddevice->SetTexture(0, g_saTextures[m_psCurrentRS->naTextureId[0]].lpTexture), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[0] = m_psCurrentRS->naTextureId[0]; + + m_psCurrentRS->naTextureId[1] = -1; + if (hR = g_lpD3Ddevice->SetTexture(1, NULL), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[1] = m_psCurrentRS->naTextureId[1]; + } + } + } + + return TRUE; +} + +void cMSStates::TurnOffTexuring(BOOL bTexOff) +{ + HRESULT hResult, hRes, hR; + + if (bTexOff) + { + g_bTexSuspended = FALSE; + m_bTexturePending = TRUE; + return; + } + + m_psCurrentRS->dwNoLightMapLevels = 0; + if (hR = g_lpD3Ddevice->SetTexture(0, NULL), hR != S_OK) + { + CriticalMsg3(pcDXef, "SetTexture failed", (ushort)hR, GetDDErrorMsg(hR)); + } + m_psSetRS->naTextureId[0] = -1; + m_psCurrentRS->baTextureWithAlpha[0] = 0; + + if (m_psSetRS->bAlphaOn != m_psCurrentRS->bAlphaOn) + { + SetRenderStateForGlobal(g_lpD3Ddevice, D3DRENDERSTATE_ALPHABLENDENABLE, m_psCurrentRS->bAlphaOn); + m_psSetRS->bAlphaOn = m_psCurrentRS->bAlphaOn; + } + + if (m_psSetRS->dwNoLightMapLevels != m_psCurrentRS->dwNoLightMapLevels || m_psSetRS->dwTexBlendMode[0] != m_psCurrentRS->dwTexBlendMode[0] || m_psSetRS->baTextureWithAlpha[0] != m_psCurrentRS->baTextureWithAlpha[0]) + { + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[m_psCurrentRS->dwTexBlendMode[0]], sizeof(m_psCurrentRS->saTexBlend)); + if (!m_psCurrentRS->dwTexBlendMode[0] && m_psCurrentRS->baTextureWithAlpha[0]) + m_psCurrentRS->saTexBlend[0].eAlphaOperation = D3DTOP_SELECTARG1; + m_psSetRS->saTexBlend[0] = m_psCurrentRS->saTexBlend[0]; + m_psSetRS->saTexBlend[1] = m_psCurrentRS->saTexBlend[1]; + m_psSetRS->baTextureWithAlpha[0] = m_psCurrentRS->baTextureWithAlpha[0]; + + SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); + SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); + SetTextureStageStateForGlobal(g_lpD3Ddevice, 1, D3DTSS_TEXCOORDINDEX, 1); + SetTextureStageColors(g_lpD3Ddevice, 1, m_psCurrentRS); + + m_psSetRS->dwNoLightMapLevels = m_psCurrentRS->dwNoLightMapLevels; + } + + m_bTexturePending = TRUE; + g_bTexSuspended = TRUE; +} + +BOOL cMSStates::reload_texture(tdrv_texture_info* info) +{ + IDirectDrawSurface4* SysmemSurface, ** pDeviceSurface; + DDSURFACEDESC2 ddsd; + d3d_cookie cookie; + LPDDPIXELFORMAT pixel_format; + HRESULT LastError; + IDirect3DTexture2* SysmemTexture = NULL, ** pDeviceTexture; + sTextureData* psTexData; + + psTexData = &g_saTextures[info->id]; + + pDeviceTexture = &psTexData->lpTexture; + pDeviceSurface = &psTexData->lpSurface; + cookie.value = info->cookie; + + pixel_format = g_FormatList[cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)]; + if ((cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)) == PF_RGBA && !g_b8888supported) + pixel_format = g_FormatList[2]; + + if (pixel_format->dwFlags == 0) + return TMGR_FAILURE; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + ddsd.dwHeight = info->h; + ddsd.dwWidth = info->w; + memcpy(&ddsd.ddpfPixelFormat, pixel_format, sizeof(ddsd.ddpfPixelFormat)); + + LastError = CreateDDSurface(cookie, &ddsd, &SysmemSurface); + CheckHResult(LastError, "CreateDDSurface() failed"); + AssertMsg(SysmemSurface != NULL, "NULL SysmemSurface"); + + LastError = SysmemSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)&SysmemTexture); + CheckHResult(LastError, "Failed to obtain D3D texture interface for sysmem surface"); + + ddsd.dwSize = sizeof(DDSURFACEDESC2); + ddsd.dwFlags = DDSD_TEXTURESTAGE | DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwTextureStage = (cookie.flags & PF_STAGE); + + if (*pDeviceTexture == NULL) { + IDirectDrawSurface4* DeviceSurface; + + ddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &ddsd, pDeviceSurface); + if ((LastError != DD_OK) && m_bUsingLocalMem && m_bAGP_available) + { + mono_printf(("using nonlocal vidmem textures...\n")); + // try AGP textures... + m_bUsingLocalMem = FALSE; + m_DeviceSurfaceCaps = NONLOCAL_CAPS; + ddsd.ddsCaps.dwCaps = m_DeviceSurfaceCaps; + LastError = CreateDDSurface(cookie, &ddsd, pDeviceSurface); + } + + if (LastError != DD_OK) { + mono_printf(("couldn't load texture: error %i.\n", LastError & 0xffff)); + SafeRelease(SysmemTexture); + SafeRelease(SysmemSurface); + *pDeviceSurface = NULL; + return TMGR_FAILURE; + } + + DeviceSurface = *pDeviceSurface; + +#define MEMORY_TYPE_MASK \ + (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM|DDSCAPS_NONLOCALVIDMEM) + + if ((m_DeviceSurfaceCaps & MEMORY_TYPE_MASK) != (ddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)) + mono_printf(( + "device texture not created in requested memory location\nRequested %x Received %x\n", + m_DeviceSurfaceCaps & MEMORY_TYPE_MASK, ddsd.ddsCaps.dwCaps & MEMORY_TYPE_MASK)); + + + // Query our device surface for a texture interface + LastError = DeviceSurface->QueryInterface(IID_IDirect3DTexture2, (LPVOID*)pDeviceTexture); + CheckHResult(LastError, "Failed to obtain D3D texture interface for device surface."); + } + + // Load the bitmap into the sysmem surface + LastError = SysmemSurface->Lock(NULL, &ddsd, 0, NULL); + CheckHResult(LastError, "Failed to lock sysmem surface."); + + LoadSurface(info, &ddsd); + + LastError = SysmemSurface->Unlock(NULL); + CheckHResult(LastError, "Failed to unlock sysmem surface."); + + // Load the sysmem texture into the device texture. During this call, a + // driver could compress or reformat the texture surface and put it in + // video memory. + + LastError = pDeviceTexture[0]->Load(SysmemTexture); + CheckHResult(LastError, "Failed to load device texture from sysmem texture."); + + // Now we are done with sysmem surface + + SafeRelease(SysmemTexture); + SafeRelease(SysmemSurface); + + psTexData->pTdrvBitmap = info->bm; + psTexData->TdrvCookie.value = info->cookie; + + return TMGR_SUCCESS; +} + +void cMSStates::cook_info(tdrv_texture_info* info) +{ + d3d_cookie cookie; + int v, w = info->w, h = info->h; + + if (!m_dwCurrentTexLevel) + { + return cD6States::cook_info(info); + } + + cookie.palette = 0; + + if (gr_get_fill_type() == FILL_BLEND) + { + cookie.flags = PF_ALPHA; + } + else + { + switch (info->bm->type) + { + case BMT_FLAT8: + cookie.palette = info->bm->align; + if (info->bm->flags & BMF_TRANS) + { + if (texture_pal_trans[cookie.palette] != NULL && g_TransRGBTextureFormat.dwFlags != 0) + cookie.flags = PF_MASK; + else + cookie.flags = PF_TRANS; + } + else + { + cookie.flags = PF_GENERIC; + } + break; + case BMT_FLAT16: + if (gr_test_bitmap_format(info->bm, BMF_RGB_4444)) + { + cookie.flags = PF_ALPHA; + } + else if (info->bm->flags & BMF_TRANS) + { + if (g_TransRGBTextureFormat.dwFlags != 0) + cookie.flags = PF_MASK; + else + cookie.flags = PF_TRANS | PF_RGB; + } + else + cookie.flags = PF_RGB; + break; + case BMT_FLAT32: + cookie.flags = PF_RGBA; + break; + } + } + + cookie.flags |= PF_STAGE; + calc_size(info, cookie); + + cookie.hlog = 0; + cookie.wlog = 0; + for (v = 2; v <= w; v += v) + { + cookie.wlog++; + } + for (v = 2; v <= h; v += v) + { + cookie.hlog++; + } + + AssertMsg((info->h == (1 << cookie.hlog)) && (info->w == (1 << cookie.wlog)), + "hlog/wlog does not match texture width/height"); + + info->cookie = cookie.value; +} + +void cMSStates::SetLightMapMode(DWORD dwFlag) +{ + if (dwFlag < LGD3DTB_NO_STATES) + m_psCurrentRS->dwTexBlendMode[1] = dwFlag; + else + Warning(("cMSStates::SetLightMapMode(): mode %i out of range.\n", dwFlag)); + +} + +void calc_size(tdrv_texture_info* info, d3d_cookie cookie) +{ + grs_bitmap* bm = info->bm; + int size_index; + int* size_table; + int i, j; + int w, h; + + info->scale_h = info->scale_w = 0; + + switch (cookie.flags & (PF_RGBA | PF_RGB | PF_ALPHA)) + { + case PF_GENERIC: + size_table = generic_size_table; + break; + case PF_RGB: + size_table = rgb_size_table; + break; + case PF_ALPHA: + size_table = alpha_size_table; + break; + case PF_MASK: + size_table = trgb_size_table; + break; + case PF_RGBA: + size_table = b8888_size_table; + break; + default: + break; + } + + // compute log2 to width + for (i = 0, w = 1; i < 9 && w != bm->w; w *= 2) + i++; + + // and for height + for (j = 0, h = 1; j < 9 && h != bm->h; h *= 2) + j++; + + // max texture size = 256x256 + if (i < 9 && j < 9) + { + for (size_index = size_table[9 * i + j]; size_index < 0; ) + { + if (i < j) + { + i++; + info->scale_w++; + } + else + { + j++; + info->scale_h++; + if (j >= 9) + { + mono_printf(("Unsupported texture size: w=%i h=%i\n", bm->w, bm->h)); + break; + } + } + } + } + else + { + mono_printf(("Unsupported texture size: w=%i h=%i\n", bm->w, bm->h)); + size_index = -1; + } + + info->w = bm->w << info->scale_w; + info->h = bm->h << info->scale_h; + info->size_index = size_index; +} + +// OK, here are our various specialized blitters + +static void blit_8to16(tdrv_texture_info* info, ushort* dst, int drow, ushort* pal) +{ + int i, j; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + for (j = 0; j < bm->w; j++) + dst[j] = pal[src[j]]; + src += bm->row; + dst += drow; + } +} + +static void blit_8to16_trans(tdrv_texture_info* info, ushort* dst, int drow, ushort* pal) +{ + int i, j, k; + int w, h; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + for (j = 0; j < bm->w; j++) + { + k = src[j]; + if (src[j]) + { + dst[j] = pal[k]; + } + else + { + // pick previous pixel + if (j > 0) + k = src[j - 1]; + // if zero, try to find valid + if (!k) + { + if (i > 0) + k = src[j - bm->row]; + + if (!k) + { + if (j < w - 1) + k = src[j + 1]; + + if (!k && i < h - 1) + k = src[bm->row + j]; + } + } + dst[j] = pal[k] & 0x7FFF; + } + + dst[j] = pal[texture_clut[src[j]]]; + } + src += bm->row; + dst += drow; + } +} + +static void blit_8to16_clut(tdrv_texture_info* info, ushort* dst, int drow, ushort* pal) +{ + int i, j; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + for (j = 0; j < bm->w; j++) + dst[j] = pal[texture_clut[src[j]]]; + src += bm->row; + dst += drow; + } +} + +static void blit_8to16_scale(tdrv_texture_info* info, ushort* dst, int drow, ushort* pal) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << (scale_w - 1); + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + if (scale_w > 0) + { + ulong* base = (ulong*)dst; + for (j = 0; j < bm->w; j++) + { + ulong c32 = pal[src[j]]; + c32 += (c32 << 16); + for (k = 0; k < step_w; k++) + base[k] = c32; + base += step_w; + } + } + else { + for (j = 0; j < bm->w; j++) + dst[j] = pal[src[j]]; + } + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, 2 * (bm->w << scale_w)); + dst += drow; + } + src += bm->row; + dst += drow; + } +} + +static void blit_8to16_clut_scale(tdrv_texture_info* info, ushort* dst, int drow, ushort* pal) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << (scale_w - 1); + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + if (scale_w > 0) + { + ulong* base = (ulong*)dst; + for (j = 0; j < bm->w; j++) + { + ulong c32 = pal[texture_clut[src[j]]]; + c32 += (c32 << 16); + for (k = 0; k < step_w; k++) + base[k] = c32; + base += step_w; + } + } + else { + for (j = 0; j < bm->w; j++) + dst[j] = pal[texture_clut[src[j]]]; + } + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, 2 * (bm->w << scale_w)); + dst += drow; + } + src += bm->row; + dst += drow; + } +} + +static void blit_8to8(tdrv_texture_info* info, uchar* dst, int drow) +{ + int i; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + memcpy(dst, src, bm->w); + src += bm->row; + dst += drow; + } +} + +static void blit_8to8_clut(tdrv_texture_info* info, uchar* dst, int drow) +{ + int i, j; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + for (j = 0; j < bm->w; j++) + dst[j] = texture_clut[src[j]]; + src += bm->row; + dst += drow; + } +} + +static void blit_8to8_scale(tdrv_texture_info* info, uchar* dst, int drow) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << scale_w; + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + if (scale_w > 0) { + uchar* base = dst; + for (j = 0; j < bm->w; j++) { + uchar c = src[j]; + for (k = 0; k < step_w; k++) + base[k] = c; + base += step_w; + } + } + else + memcpy(dst, src, bm->w); + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, bm->w); + dst += drow; + } + src += bm->row; + dst += drow; + } +} + +static void blit_8to8_clut_scale(tdrv_texture_info* info, uchar* dst, int drow) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << scale_w; + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + uchar* base = dst; + for (j = 0; j < bm->w; j++) { + uchar c = texture_clut[src[j]]; + for (k = 0; k < step_w; k++) + base[k] = c; + base += step_w; + } + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, bm->w); + dst += drow; + } + src += bm->row; + dst += drow; + } +} + +static void blit_16to16(tdrv_texture_info* info, ushort* dst, int drow) +{ + int i; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + memcpy(dst, src, 2 * bm->w); + src += bm->row; + dst += drow; + } +} + +static void blit_16to16_scale(tdrv_texture_info* info, ushort* dst, int drow) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << scale_w; + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + int srow = bm->row >> 1; + ushort* src = (ushort*)info->bits; + + for (i = 0; i < bm->h; i++) { + if (step_w > 1) { + ushort* base = dst; + for (j = 0; j < bm->w; j++) { + ushort c = src[j]; + for (k = 0; k < step_w; k++) + base[k] = c; + base += step_w; + } + } + else + memcpy(dst, src, 2 * bm->w); + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, 2 * bm->w); + dst += drow; + } + src += srow; + dst += drow; + } +} + +static void blit_32to32(tdrv_texture_info* info, ushort* dst, int drow) +{ + int i; + grs_bitmap* bm = info->bm; + uchar* src = info->bits; + + for (i = 0; i < bm->h; i++) { + memcpy(dst, src, 4 * bm->w); + src += bm->row; + dst += drow; + } +} + +static void blit_32to32_scale(tdrv_texture_info* info, ushort* dst, int drow) +{ + int i, j, k; + int scale_w = info->scale_w; + int scale_h = info->scale_h; + int step_w = 1 << scale_w; + int step_h = (1 << scale_h) - 1; + grs_bitmap* bm = info->bm; + int DstRow = drow >> 1; + int srow = bm->row >> 2; + uint* src = (uint*)info->bits; + + for (i = 0; i < bm->h; i++) { + if (step_w > 1) { + uint* base = (uint*)dst; + for (j = 0; j < bm->w; j++) { + uint c = src[j]; + for (k = 0; k < step_w; k++) + base[k] = c; + base += step_w; + } + } + else + memcpy(dst, src, 4 * bm->w); + for (j = 0; j < step_h; j++) { + memcpy(dst + drow, dst, 4 * bm->w); + dst += drow; + } + src += srow; + dst += drow; + } +} + +static void blit_32to16(tdrv_texture_info* info, ushort* dst, int drow) +{ + int x, y; + grs_bitmap* bm = info->bm; + uint* pS = (uint*)info->bits; + int w = bm->w, h = bm->h; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) + { + *dst = ((*pS & 0xF0) >> 4) | ((*pS & 0xF000) >> 8) | ((*pS & 0xF00000) >> 12) | ((*pS & 0xF0000000) >> 16); + pS++; + dst++; + } + + if (drow > w) + dst += drow - w; + } +} + +void GetAvailableTexMem(DWORD* local, DWORD* agp) +{ + DDSCAPS2 ddscaps; + ulong total; + + AssertMsg(NULL != g_lpDD_ext, "No DirectDraw object!"); + + memset(&ddscaps, 0, sizeof(ddscaps)); + + if (local != NULL) { + ddscaps.dwCaps = LOCAL_CAPS; + g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, local); + } + if (agp != NULL) { + ddscaps.dwCaps = NONLOCAL_CAPS; + g_lpDD_ext->GetAvailableVidMem(&ddscaps, &total, agp); + } +} + + +int STDMETHODCALLTYPE EnumTextureFormatsCallback(DDPIXELFORMAT* lpDDPixFmt, void* lpContext) +{ + if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) + { + mono_printf(("8 bit palette indexed format\n")); + } + else if ((lpDDPixFmt->dwFlags & DDPF_ALPHA) != 0) + { + mono_printf(("Alpha format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount)); + } + else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0) + { + mono_printf(("RGB format: bitdepth %i\n", lpDDPixFmt->dwRGBBitCount)); + mono_printf(("bitmasks: A %x, R %x G %x B %x\n", lpDDPixFmt->dwRGBAlphaBitMask, lpDDPixFmt->dwRBitMask, lpDDPixFmt->dwGBitMask, lpDDPixFmt->dwBBitMask)); + } + else + { + mono_printf(("other format: %i\n", lpDDPixFmt->dwFlags)); + } + + if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 16) + { + if (lpDDPixFmt->dwRGBAlphaBitMask == 0xF000 && lpDDPixFmt->dwRBitMask == 0xF00 && lpDDPixFmt->dwGBitMask == 0xF0 && lpDDPixFmt->dwBBitMask == 0xF) + { + memcpy(&g_AlphaTextureFormat, lpDDPixFmt, sizeof(g_AlphaTextureFormat)); + } + else if (lpDDPixFmt->dwRGBAlphaBitMask == 0x8000 && lpDDPixFmt->dwGBitMask == GBitMask15) + { + memcpy(&g_TransRGBTextureFormat, lpDDPixFmt, sizeof(g_TransRGBTextureFormat)); + } + else if (lpDDPixFmt->dwGBitMask == GBitMask16 || lpDDPixFmt->dwGBitMask == GBitMask15 && !g_RGBTextureFormat.dwFlags) + { + memcpy(&g_RGBTextureFormat, lpDDPixFmt, sizeof(g_RGBTextureFormat)); + } + } + else if ((lpDDPixFmt->dwFlags & DDPF_RGB) != 0 && lpDDPixFmt->dwRGBBitCount == 32) + { + if (lpDDPixFmt->dwRGBAlphaBitMask == 0xFF000000 && lpDDPixFmt->dwRBitMask == 0xff0000 && lpDDPixFmt->dwBBitMask == 255) + { + memcpy(&g_8888TexFormat, lpDDPixFmt, sizeof(g_8888TexFormat)); + g_b8888supported = TRUE; + } + } + else if ((lpDDPixFmt->dwFlags & DDPF_PALETTEINDEXED8) != 0) + { + memcpy(&g_PalTextureFormat, lpDDPixFmt, sizeof(g_PalTextureFormat)); + } + + return TRUE; +} + +void CheckSurfaces(sWinDispDevCallbackInfo* info) +{ + int message; + IDirectDrawSurface4* lpTS; + int i; + + message = info->message; + + if (message == kCallbackChainAddFunc) + { + GenericCallbackChainHandler(&callback_id, (void(**)(callback_chain_info*)) & chain, &info->chain_info); + } + else if (message == kCallbackChainRemoveFunc) + { + for (i = 0; i < LGD3D_MAX_TEXTURES; i++) + { + lpTS = g_saTextures[i].lpSurface; + if (lpTS && lpTS->IsLost() == DDERR_SURFACELOST) + { + if (lpTS->Restore()) + Warning(("Could not restore lost surface %i!\n", i)); + if (g_saTextures[i].pTdrvBitmap) + { + if (!g_tmgr) + CriticalMsg("Hmmm. Should have a non-NULL texture manager here."); + g_tmgr->unload_texture(g_saTextures[i].pTdrvBitmap); + } + } + } + } + + if (chain) + chain(info); +} + +void InitDefaultTexture(int size) +{ + grs_bitmap* bm; + int i, j; + byte c0, c1; + + bm = gr_alloc_bitmap(2, 0, size, size); + + c0 = FindClosestColor(180, 10, 10); + c1 = FindClosestColor(10, 180, 10); + + for (i = 0; i < size; ++i) + { + for (j = 0; j < size; ++j) + { + bm->bits[j + i * size] = ((i + j) & 1) != 0 ? c0 : c1; + } + } + + default_bm = bm; +} + +static int FindClosestColor(float r, float g, float b) +{ + float best = 3 * 256 * 256; + uchar* pal = grd_pal; + int i, color = -1; + + for (i = 0; i < 256; i++) { + float test, dr, dg, db; + dr = r - pal[0]; + dg = g - pal[1]; + db = b - pal[2]; + pal += 3; + test = dr * dr + db * db + dg * dg; + if (test < best) { + best = test; + color = i; + } + } + AssertMsg(color >= 0, "Couldn't fit color."); + return color; +} + +int init_size_tables(int** p_size_list) +{ + init_size_table(alpha_size_table, TF_RGB); + init_size_table(generic_size_table, 0); + init_size_table(rgb_size_table, TF_ALPHA); + init_size_table(trgb_size_table, TF_ALPHA | TF_RGB); + init_size_table(b8888_size_table, TF_TRANS); + return munge_size_tables(p_size_list); +} + +void init_size_table(int* size_table, byte type) +{ + int i, j; + tdrv_texture_info info; + int w, h; + d3d_cookie cookie; + + info.id = 0; + cookie.flags = type; + + for (i = 0, w = 1; i < 81; i += 9, w *= 2) + { + for (j = 0, h = 1; j < 9; j++, h *= 2) + { + info.bm = gr_alloc_bitmap((type != 0 && type != TF_RGB) ? (type == TF_TRANS ? BMT_FLAT32 : BMT_FLAT16) : BMT_FLAT8, 0, w, h); + info.scale_h = 0; + info.scale_w = 0; + info.w = info.bm->w; + info.h = info.bm->h; + info.size_index = -1; + info.bits = info.bm->bits; + cookie.wlog = info.bm->wlog; + cookie.hlog = info.bm->hlog; + info.cookie = cookie.value; + + if (pcStates->load_texture(&info) == -1) + { + size_table[j + i] = -1; + } + else + { + if (b_SS2_UseSageTexManager) + size_table[j + i] = type + 5 * (j + i); + else + size_table[j + i] = info.size_index; + pcStates->release_texture(info.id); + } + + gr_free(info.bm); + } + } +} + +int munge_size_tables(int** p_size_list) +{ + int* size_list; + int num_sizes; + + size_list = (int*)malloc(1620); + num_sizes = get_num_sizes(size_list, + get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, get_num_sizes(size_list, 0, alpha_size_table), + generic_size_table), rgb_size_table), trgb_size_table), b8888_size_table); + *p_size_list = (int*)Realloc(size_list, 4 * num_sizes); + return num_sizes; +} + +int get_num_sizes(int* size_list, int num_sizes, int* size_table) +{ + int i, j; + + for (i = 0; i < 81; ++i) + { + if (size_table[i] != -1) + { + for (j = 0; j < num_sizes && size_list[j] != size_table[i]; ++j) + ; + if (j == num_sizes) + size_list[num_sizes++] = size_table[i]; + size_table[i] = j; + } + } + return num_sizes; +} diff --git a/libsrc/lgd3d/lgd3d.h b/libsrc/lgd3d/lgd3d.h index 56c69e4..312f8ae 100644 --- a/libsrc/lgd3d/lgd3d.h +++ b/libsrc/lgd3d/lgd3d.h @@ -430,6 +430,10 @@ extern int lgd3d_g2TrifanMTD( int n, g2s_point **vpl, LGD3D_tex_coord **vptc ); BOOL lgd3d_get_error( DWORD* pdwCode, DWORD* phResult ); +extern uchar* texture_clut, *lgd3d_clut; +extern BOOL lgd3d_punt_d3d; +extern BOOL g_bWFog; +extern double z_near, z_far; #ifdef __cplusplus } diff --git a/libsrc/lgd3d/lgd3d_g.cpp b/libsrc/lgd3d/lgd3d_g.cpp index 5914642..08d6d62 100644 --- a/libsrc/lgd3d/lgd3d_g.cpp +++ b/libsrc/lgd3d/lgd3d_g.cpp @@ -1 +1,9 @@ +#include + +uchar lgd3d_punt_buffer; +BOOL lgd3d_punt_d3d; + +uchar* texture_clut; +uchar* lgd3d_clut; + void lgd3d_set_zlinear(int lin); \ No newline at end of file diff --git a/libsrc/lgd3d/tmgr.h b/libsrc/lgd3d/tmgr.h index be50624..3fcd553 100644 --- a/libsrc/lgd3d/tmgr.h +++ b/libsrc/lgd3d/tmgr.h @@ -53,7 +53,7 @@ typedef struct tmgr_texture_info uchar* clut; int next; int size_index; - uint cookie; + ulong cookie; } tmgr_texture_info; @@ -63,6 +63,12 @@ extern texture_manager *get_dopey_texture_manager( void* driver ); extern texture_manager *g_tmgr; // this is kinda silly, but it'll do for now... +/* tdrv.h infos */ +#define TMGR_ID_SOLID -1 +#define TMGR_ID_CALLBACK -2 +#define TMGR_ID_INVALID -3 +/* tdrv end */ + #ifdef __cplusplus } #endif diff --git a/thief2.sdf b/thief2.sdf new file mode 100644 index 0000000000000000000000000000000000000000..b55e0bad98f7fd656c6328d685414a88295a94ee GIT binary patch literal 327680 zcmeI537i~9b^mK>W@l!v*+a)lE6LJY)-Bn)vgAWPv@1)tj1AIaJ2rR0vN`@TA7cDJAY-G6+P(JLa}#H;oSd49K(q4H2m?~cL$SI-`O0DN6C2c&lklJFAxBM7dHX< zk5*sYF2Xwy009sH0T2KI5CDNQoWS6_e={n+|1UUpMvLp@nb@bVmS?p6r{iMU|8HQi z4LehHsn@33Qyq!*sgrp zbiO2?nomLtNLU;sNbzr7C5DI&uL&_Rp^ZKb){ueprbQnM=3N};GL z7YcISv)&-&_~qSEwN9a0H-w#QrtAgpPrWHr&JA(s4%J9`hN`G#D7#Ip9h;=DI=v<; z*R_Y5joVVFdS!MU-JIo7)9X+ojY1^kf>dLumFm`&N6G)V>#Gc}i`dPkGNLo^)cio{ zS){tnwoVsTmdz2jZOioAy8c>f_VIAvaa*|W7HQY6rLohgd{RT_fw#@_5%4v$b}Bi? zHZCl*AoYGX1T#o*wQh5iG8)1?ShHCeg7u1wXE??OSCt2(8rSm)zYz%s{SBp-ABb77wK#{RY3!aR5nAD z)4i{ua*Ii*oON-!f1z$&lrom-b3)Lc7ztdgm#C+V4jV8HcchCZ8tVF-7;Kc|+z04f z5b2O6rbzti3Klid{a(HP2Fkd$l0}UqaFbr5mNI-6Bc*BsuqB~SxRe}mG39E`y z_N?X7R~sQ08LBhYhzq?_Bt?e6Bz%}p%J<23E4ooRA8V<|im+nwh0C0MRD-jAA>c~u zG`ba@H8}BWm!Q--&4hfUPpv7%yW(|#Yw8eKP0tK)&`bzI;d}*OlF3rn)y|&D}(MglM=IgsQc3iW6{mJf=mmgho z?2?nKI=W7t-?8G*l9T7{o!@cJ$@ZR^T{Ak`dZ$>8Ee(h2x@sfIp2W_Y&9tXq@vW&t zHT3v(|x z2!H?xfB*=900@A<3rXPJ4@T~d$GX{NjuGPT|7Tmjkyi`F`*^8TV&0awR$MVwQ~k#S zR--k8`BOT5!|uYSt+!?SiUpP*9m!`$i@B`*D+ofVHMhG|n#Wunv~Zs5nIQDjE6FT+ zKVjZHTlH2mJ=IW8nx5gzP*zmIOv+*rQWjjQC)u;~3CW45aqCaYT9`j+%5KjLj%nIT zrM1rpWf|=?0ordC9NsUpOmJ;_L0$|-AaY1(k2X-}C|jsMM>E9NH>OBu%D&Ya`i5=D`RtF~RNfF~DX8kmnCcfV zoj|{+)hzVFQMO-1Ms2=z6Y3Xpm_PaYMc+t&Hk~VGhtfN8!~Ny^$8_=Or)Q#VcSH`o z<=Sj>s3irJ<@#kkram%b;(eq!Gy(+mh5L#&0M@xg#CON)u@6O@>@ynbVPd{pTE?qoIp>L;tZ2 zTf^>lQ$Sxi6S`IP9{lIhm-G;M4b|&QR;l#(xHg%0RKs4cRK$BJbCPwrwVvI=f-Vk( zDLYNTFq%2D1vd;P0*Q!Aa7FhD+vtV~4FJ=bKlug#S^(HfJEc;t=d^xt9%I`>J-1xEet7_Yr?p2_R zFRP}R3HIKau~x0YtwqdEt}1(tCIjYlYIRFox*-g#6qn08W#1a9HF-Toijliw7qFb| za+6ZztP@=uShp(s{Q9p~TDQj6e|>9>3#tJtOw+-twZ<}LC)cU5onk3&J0+V=C_`{D z4V9hBeF-k~mI`-Of-CIsEj3gx45_u}SW&G9XuYFlB1;Xi1Q%UNygZA`bxy=c_ZF$44L~ILfU;QuDGWeGD;y3%n z@ACM5nMwX;N3Y10zZDX(#l)|xs9)t{cGd^vuTSi!-_D_5%#*TyMYsY15C8!X009sH z0T2KI5C8!X009s5J@^M?N)NN8kT{+)=K++unGZzyCj7 z^`CBr^^^Gh|K((?_`eI{h!+Tez>AxJ`X4JVZZF{-2!H?xfB*=900@A~l!sJG9-5lup}AQeT3Y0xwN)ObOp%AFQ{`dWG!3m00ck)1V8`;KmY_l00hoB0^RLT z&fGHd=^56H<{1auI@^v+-#mSMTAu#-_Og)lBMozoY(k?hVF(Z>$lWDU1!xb*Bz|wtUZ$4oE%T&6D)CGd|vz$HQhB&#ZV#-*p^{(*ONGhy5n#Uagj)9udHpwN_*= z6mR3DQi(D5)**34PZy~EDFRlbMgQ)=m(uAQb{95ny)D~UEU>K*EXD7^mux}-;dgf0`Nv>a3AUq4|ximt0f=}{RdW5#ni}W-y ze^Pq3XA0Y;yh+n#oHPYZSDKnbYAAy=O=13|H04J}1jlsHvw0rDE23z*q#xot?lO`gqW{-iv!kLlcS-{4q(Hl5ED z14uQ+JvF2_u2)RwN^vl#Qj8S0F@Fju9?2JTBg27)sp-5bPCAL9@1=AG!>e?jL!D4h zN@spBQydr>9jeaV4GB^mY?Dg0+jDfo$laODpF*lb4wp)6pJAS!jdtJHt2Lj~kRe~9 z-A-pRS?4i3xmtImom0_t^S&!ltL!+X(vgxCapQNbS)IylCC>wm%rRgoyWLG@16a2z z=|yh6Q}IieFO58SSZPs5C9kgSqgPtD#T!qp0Mkv?FcqqFrt_Ih)|Jdo%B8WLE>mw< zNXs5u;g&GmL|Z&XrowAVxSbJgVc2!-{cftlG;Tm2bw^?k==F{<=5V-;#AmWsIvfrf zR^4e%gk@Z7>bF!A7NOE*M7}%y+FE5@WnIstpx%`};Fn!3voT5z}yy;2XT?T-FF&FI<; zHiIo^yWC`OP4*E}qf<`3Yyx9|m=nb0Dqe2;&>CA{O%=JpZfw)T#@ls--)T+dUkyxQ zzBScAZZI2|xU>}&{Y$8cuBhTxElsC-vQ-3E9h#Q(#Me`CtC{(et)-Y7$`*>5A@P5$ z%!|Yfrv+88ZA9h5v0{auHI!so>LvbHirTb5IM1JLUy-)pO54^Zo8hPwa>jVyS}b491SLv) z>xQ`1%4AX#l>?Ec9I4V-hq>pXv^%|MtFWEoM)_A8^^8Ci$w{GjAscm*$bQ+WOs|1poMB z3BL5%2EO6ZIRE~?#`$gk5a;~OasI9+;(XZ`;{30F6z9G4^Q&B(|4D6vKXgkYf8sNZ z{Eko8^4705@znS0`TVI#{=rp^{L#JyU-`)d|Lb)LzTs^N{?ws3-w{dh2ptbtalU9? zg0nnlE8jP(riK3h-#biBAumKA!g@kudPoQvAOHd&00JNY0w4eaAOHd&00JOzh7tJE zzy&p}u`TSeGt4fS0|Fob0w4eaAOHd&00JNY0w4eaATW6ZZu`%knklsZ|K{XXiJCwF z1V8`;KmY_l00ck)1V8`;KmY{JFalkF^wOHCwEzF%8D1pyEM z0T2KI5C8!X009sH0T2Lz>Ir;!>ayR?jCHd+o&A3_#@Otq|5H}5klw9QY3(zNB~^{Z zQc0bbKZ?3a&Wl-bYbuk;I+xjLAUBvTu(6$Kd6FK^3}pjXs&4OB?bkb5FI&De^59{0 zUmeY#UL@#toZB*8t0t)>{`jW>C8#iVyly_XSQ<#I~?conbAUa zl;wA%?X!Y&WX>f^TFOavw5xUuJVLx(m4D)%*)oCmb_!nLMF!4fGuaBZ+fBBCxm}Kd zgW1f09fG*4$g|{hU}xjhHW+gw@*x}htg!U~XWUDx(Q0S@luqBUyRd2NZP~tJf%T0H z59GGl4$49j=G^X5X)$xP>|t!XXM|ICjcn>CJOHjvIw7@f%%6OkoQqt4S)EpdbOwW{ zbh@1^pmQ4YC!bCc&2$BgcXC!A`iqq&X+wE0-8SvCZJ);6P<}Aimn)Wa@~$YUbTK>5 zD3xy115Wy}w)sOinjOfFW{3N-Wp&;iBb_yRopi2r27ya43T8z&`$mTH#I}4a@2w$~ z@iHon4am@JePor&biQx9tk=|R_r*!A7}@lf@-#?Y%8=T*%%6N}v%BnorZa^?c4+J1 zZduCJ-RZ^h%?Z};%>|ADwXAzCW91u@zn`}IBbyuU8yxG;(x6xjxU8vtOOn*q>i*KX zQd_P;`TNW?zuJ*}F*h69~=TG}mZdz+|#|nVo!)X|~g^)kUsfj#8or zpISngE5lMM9VuB6w^=_R{V4l3JKQR$NeEkSW*>2rZe2CDbSv;)Q;!((u6N8b&)cpG zKI6R_wONAM^EQpb`ux3iT${fSRueU$QkgDB^hHc2tH;`8-OP6Q+X+qMIu~_8(W3dY z%pIEQ?K=e#Rp*p30~_JA8&7ST|8v(qArX4bF~(DPaT&YEO}cdztToxS-cf0enc28X zF>`$M#p(mkB~}ZVOx6|FwbmxqS2mNSiLoc`IDwf#jBjYk8oQ1>D@#Ksl6I&g$cfPKGm@OsT^Yz%dc`9Y^%V5?l=1y?ik`&M6sSGnJZtcxK)%xIXFN-9P=h0PWJl#w8`Il! z!+}TfX-`i3N)zb~K3hgT0mk@|AGNCr4`nIt&IdZ`CEf#O{Qx$Rf;@b6m4!&Z6Qds7}7pV34fR(cXlp)k^yE@pR?hx$Y- zshr|zlV?h0@Bu&aCaLs4e{ZfHOxw@?>_BF0u$aC*GdNbB@i(RrT0o)dN9zLl%8;eZpQJd9{&9GgZwrU%q19#;qQpQ9P& zMitGBZ%-#0Z2@(P#>POtGGj6Gr&G`f4>Ey=7JjdqN2&?s-a`xPt=UW_YXvc|s=l&LzhJFLJDdb+FZJubVW-ElR_Y z{ql4@mxh_3O2l*8#LH`QAPB+wTj)x2a)P?V5ZRTdZ5v`21W`fJAN8xc2kl zL*{2%Fe+c&P?ZJCV z*c-pQ-qop|wn$I&HLhf|M_~W*xjbz#xMI`vxRgUrCDfGuN=(msBd}c(kWNGuGS5vq zqox{MlWI!C4+_*Cf%t1qj}G=CX;-Tr9qd!0E-EXt7lsGdscFymOw->~GXV?F-3CF* z7E)D|==rlRw{B%~9HZ@W3k@4G$8Yw5>&XOhS0`G5QA*?+TdOz@9?JI*hDLxLaOn&8*onc&CvCiu;V z68z`QRA*;`Gy3`A#}C9i==c9;gae|0;0OXB00JNY0w4eaAOHd&00JNY0w8df6FAuP zq4>G9|DTWj|5+YMm=6LV00JNY0w4eaAOHd&00JNY0_6#e-TblmeA@pn!~VZKB-{Z3 z5C8!X009sH0T2KI5C8!X0D-fdz^42EDt;dA|5sxFf0joQ=7RtTfB*=900@8p2!H?x zfB*=9KzRb^{q*tp0^0wt!T!HIB-{Z35C8!X009sH0T2KI5C8!X0D-fd!0#7+ExwTU z|Ld^-Kg%Nt^FaUvKmY_l00ck)1V8`;KmY_lpge&;+;i*K7SaAcukZh@b?jA6kr+Md zU;~S6*qKCoIDG z`Kq|!B#`$K@Yj+LcC9HH5?+xx-CUV^h1a(j9qB35)qI6#YYh~+Lo748)h=lZ{_EQnB zFRQ}SsPGkfo188(Hd1%`py+^9Ms)CAIkqe(l{E0kraM)LIk#lS6p`VFp>#CUEzQ6( z-bn*hkyaX_>dFmKJ|_)A4msYWBtW*YmH-KLN@ zbxU7$dQDWWYYz>K?pR3GE3@n9<}8nzUWXEC6e1xPq#8r5RJX2t+QD@!?qTtUc^7ox zrh_9m<0xaMQ+=0u6jgQ`Wv}*XQrS}|dyZ|ocT?I>UX63dr-Smm@~ZL{8XcO;O;iT= z45G$*o2cGpL8GfEOqJ=KElMp?-ps-u4Sj6PUVwYqxF1H<$X7)24!43m2{%+YoOA^1+<<}f-^{P zweEG4G8)3G1I=ck($4NfK%5`$pg83vU-jnx*`7ABhCaVj3y zZh6G)^@#5lmD5{G4VCTEQN%=sdCZNJ)ni8{s7JY1L%neWixCXt%1B0?Zq^Z-a^1g{ zs+cd9sO@CG5Zp-N>`mom**dzpY@?h=I%Gy%Nb6oEM8A#2Ph`{C~~zFP9doF3&gHmv^l9-qK9faRoW3Arl*N)<;6^Kp@%0S z!gJ~+$qZ3W_r8Y8Ev5!k&bm0=zfiX>N*T*4HN6-KT&$O!qw=v=h_jtITzx!UX4)fFsiqWisi{SB0HZ6%8uN#G{EL@j0bEXvE?S1X1wX+s-f zS|oRnWQbxuOR%e?$JdGNZO|#pNOg{s^=~`>wc}SUzl@wX`On9HcKjbt{`B}yj{U>Y zr;h&c@DF;v*Y(}ZcTWEO@nbDd9{NVt6UYDV*w+q!<>;3(kM(}B=LH@9%z3$Nequ+WYq7Z$18}hu?Jcp5t%W`TCQ)JBo)#dv^8= z?%dupu(SW2XZHTnM@AHHHS?feRl~fshlt9(m!vlS!K>dDW>R~Aw7oy=_oDkV7Nm8pp$~VxBMR}@H z^aOj_5Pjx=V{fAKrxVLLXR?B11SSe3(zl_sPC5c1PuWtfe9=!ir;*J!c=);Cuq2 zb;;&~i|~itva}ca#&YlszXLv-(pkki#V!#L`zEo*P9*XzeQlKaJcA zuWvcEfp!^e+E+@snIt#UJikn*TW#&+#(YYmfv7UA;)e2WhPW`VlH0^BJ$mgTBRDBe zrA+FIUiDLil#@Xp#EInyHEd~Zf@W3os##YPCn;(qVimLB9ek4_bAM{NY%`*J=_RJo zP4jA6Ul30rsX5B;sp3MfBSIPG)v+$cNvgv?HPzFC(O&pD>tE?AjX8!EP)<}I+iJ@R znHJS`<%Dfp^wyRvC#tPzwPxQ&jnll|7Jb*WpqWA?+^#=eTScu5^L>y#fZ$~MHw zs7d%_GDe^$^2wxauD&vV9v}2cM{3A|34Ah{An`7H|2;`oQ1tyRtx{WPp*~*S_Q57) zs>^Bl&gV$}p{$wer@h5QKB;V>R;6tz$`qE`)Bu;FML?w$k!QO%yX`NTmjTm9jEx*FC|1m7MH7)EcFdt z)G_Vh$g|(~;h*orBPu*upUS1EXH@!B&c@^!61WdcM=~WXreqe*O5@j{nW!FC9J7^VqS^_I~on zM@~L`^h0|O9eZ!)J&|`Ed)uM69(vQ^y+`*Py1i?3=g{%(Pi{S$Y1tA*2pWH zZ{Bj_eZAeA?z=v7UF6!6*K}NSbp6S7hkAO}?!RL1Jxng!Go$F8U$PM?O^1d*_vGYjDinv?z|0r*rxU-Dh47?mWZ(t9* z$+PU#c61A;#fv^vab7A%&%55aw`uv($b*NKq&m9hs|Ip86c{tOC)B&>nfIy4?>rlA3;plQjp!FrRcqMYZqmG|V6w@q z^^Q6-VY6+O2n!e4IJIUEeq@T>3s!_(@%!psS&i0A=1=ML4Z91Qw%(TQD;AvS74n&3 zf=w?8c5Zj6w3xX{{+qGwS_7~vuaSN8gzkZTL%drJA+0u8Tag=J5pD4@X?-?Ap$#`o z0rEuD9T#MA=Z&Q;WX1oD;6Y0RH=KZQ=em;U)8(lGJ)qQP3hWU^ky?4)aSCk)wyy%8%sW0VsR ze#u5qD(O>3q|xNRmv?@!eaP-5484gx;-(3iY8t-00m|zIYSP#|$&-ddVePm#!AF{_ z37F`PuA$T{7c-fx_0~<+7FP6)X6|GZj)ylJ8SYKebQEcI4fSHFon2rIt8nLXcCVZC zu)6b+!Dv%N*E`zG(KB1;#a;u=?5SQvEjS@9vZK}+c1Cm6cS;k|bmmXK327iVm`x95 z^0JU@DE`?fGHv3sQEf=2tEHN$DAE?82{1SnsR__L71df(m_KPMhX-=oDolNmnVj_L zp%5^XzGfdz=fbKDO?|FDd7@9WfuVACH9b!>7jJ1@Ypr53S!re`R~wC!>fAp__Ki4h z+xN+!35W_eO=IUA$Nw@1@tekh7m*T{=h@fYr0kuLL578C#E{1gc{e&HnLB1M?zXU= z>vdiKTAU^Zxi)t}d5h!7Jg-myh`d~B1a&SumtDl}bdw8;h9Y(D3o`qk8iy<~hidN4 z5B5&KlNTD@o6F|13)$=4q+AlygE}YoRBttfcfF&>97;3uvZ18kvN45jpR`6e@|BN`g%fBhuM=YF%1cmJW0zv_v4-uB*B{_B5<^ViiSc-@)= zzyHz%|I1rayz{T>_)`PT{CHa<|LX+_{*ny|{=M}HzNJ6G|L;G=`D^iCDdoB2m~CfFszC*#ZL_x}ef2QKU`azFqCKmY_l00ck)1V8`;KmY_l00hn&0?&Tq z5Ao%+|KExI|5+0=7zzR)00JNY0w4eaAOHd&00JNY0uv?hgGC(=ub{vGe=YX^RiP8l zLjbC(P(cU;KmY_l00ck)1V8`;KmY_l;7lSg)Rj1&zW;v^o7yueDzF6vKmY_l00ck) z1V8`;KmY_l00btLz*oP1MdAY5|9=eo|4HSF%0K`FKmY_l00ck)1V8`;KmY_l;7lU$ z?Y9g++)2Ox|9R~Hs|rgK{r-RWA3au86ha^X0w4eaAOHd&00JNY0w4eaAn<|_SpCIU zCA#SQ|Nn#i{|goaC6)BM%-9+87CD$ZMw_dG1MAYemLF@ity6l^9dE zBJ0EzV;5EbPxY)uYaa8bboz$fg-u&;%k~uuY-^^FP4^9E3Wan&GnyTyEb$V`t-0N$ z(qi`?_(hg5w%s*FO3_;lOVaxZ-4S(*YM5dzVE$y#XJ?J{XVbZ2b|{_emlc>SSQa4* zf}g!83xpk^7g?}~`IEr{+w*jv(S}lK?K4bzDQb_bvO^HkIrmaI#qBPA=M=tfri912}r9BzV+pLeh)+!XeRJuh3k zRZsBRTf~rey<@JqD=HWLK6y2I{f%0%?278>a9TUAwTCOJX%9Y?#OX37lhtPxt=F@+ zn|k5Ej;h)N%k8R8F2BQTGX>Gf+}2J#-oQ}MaoYuRdtGFW3V|P=y1K;JE`+z6*n8Y$ zXcyJ`VX}3-qum^Dv%!_(ZHn{SYUAvxqc~r|WU{tdyR0{``>T($X+$y;GD%j7wW+@d ze5P3U_}Z-sv3tDK7;E8iFZ**hRUK=SCnjr8N3??z?M-&H*MvQEy$_twL_3H1lW(FO z$PH%Gh1|B`OmS>9TYi=$?k1R=)e-98;b4oVd?IR|SevbB%%6fv zcjSiqB_!Fj#A0Hex0u+-Sr60uppdL*-E+$?CYr5w=1)P5E?!Sz3@KI*1`Wn%sf zWciIXjj!&IrbSH6vAxFSZn!N8H}rUWb)I^TeR(xe6Dr+G3B)oclXbQAa_bg0$O2w7 znqUK23WS(b%iW@(Ros#@s63g_);?gW2iae}Y9 zCBZ-caDpFssEL2)F8bM<;$OV8m4AIh6aQJXiEr*n@^8*d^4=#CoHf_5uRZaen=hjO z|Nrmi;mu_F|LVNR=Bq-D_kT4II1d6K00JNY0w4eaAOHd&00JOzRuK4)zkgriV*366 zg#LNhSz$Sh1OX5L0T2KI5C8!X009sH0T2KI5U7^G7gqj7;u6~bw_^WaEi%Y~00@8p z2!H?xfB*=900@8p2!Oy@N8s*#pH5s#`~TV4|DScSgTWvG0w4eaAOHd&00JNY0w4ea zAW$uVr+z(t^BVg5|Hatj=1+y)Lt94%3#_<1pOrFFQ>ipwvLfn_>mz-p z%DlX_vhGE+Br?<`Wfq1CHt#Vs4(rmAGB>x&ZHf8JXm+?Ltcz4` zkVkZDc06}$UdL3Lur;TtS@<{)DdIX^@4UyzSu~2}S~7SxoEgeeG*#`!fcp>+D^X9m zepbnlT}-8k81h``(ugaEU16EmBz&FDM>p^HTX#sDuY0a^Wv4qucUn8H_5PjDqxV~j ztt+jUv8`o$zt+7bZ#3{Vj>2>2sG7zu*ZiQlCXUagap(=$)Hv8U%~oE!iM-K{$yMP- z5Ns#v+G?~~nLnk|H|#EK+Im~IuUKHC*@1$Tl@owiMJ)DK5w|n8U2C*Uc z)mTl;pQHx6m&r+;YBA~B6(L* zoQO92ba<-#OQS{`9O;wISBROMdTo@P3I;lcqf}@~9?IV^r!s z5uF*xmzRXEj`@?sH<%j^toF1y)-u)P<*g6;${49>V{L4imZTc$QsU^$veLC~)dl>q zk?xjCzTUmp(`h=ZWXBy$r3u)v-qAA2%Prr?{|4p0$s@)#7}*9_(mtQuo-mPx%U#di z47H5C-R>PK#1+k$Y_eu}$OVBHn!sh3H}dh9H1d&(wJv&;+jSP2no!{BnxvEp#bneBhe5Sblx;3xv z&y4PnZ`t8(^qkjM7q{oK11rxj^bcs#Da(Bfdm%kE(l2Wg_wfP&5C8!X009sH0T2KI z5C8!X009t~YyvMi65+GQIcIeI&W}33a}DkP&v*9!NwNQb+TQ<*UkUi_%Ex~B=_`kB zz3y$V*>}}v9+>wjX4P0%U2xU1WqtX)FiZ-q4hcoAYu8_&>mPJQt_+DJt(Rttnf^>M zGt@7{@B#r4009sH0T2KI5C8!X009sH0T7r(0vq$3FX*KG|7Om=`^xv;w2}7zw>kU& zI@85^cwDR3oX28rzO*pMqw zV-Uy<7qg=SnZB$m6*owY4euBpxnnrppY8KLjz|~;hq6Okv!m&OvEja=ZdTvMfT$`6CSW<$Ac+2QPHt}op;GE7Y>LjiXwwHU;=W(wJ~zjd}6 z#D)oYA+NWaDV3zsnZaDfYwuGHvSWqZ@V0cg-f3lJeXVi2K`hh^+YCatXGU|Gt%F{( zm|+mg6pN#|tz%l_nOR9H+os*yc$-!if zK`K8wlFyD7ce_=cV-U*TuDAEO28sUcV0N3{h2|NAvb*wwxxQR6Jwm_qG@9%8$aWZ{ zhcbPmBQ&rK(62nX)}32caBP@FUAg%Nx%>#pq;tc4gJYWN^U6yOV;+H$Z2i7T2xkUQ1^IoS+V?RX4_E4)w`suU~WK1v$TSoTiLP-LO#&T%L--(3trq- zR1nK~VLQLP*l@olcY#4pjF`Hgod%h~%+{4&xGB%%ebGCr7g)Gn6V#b!RgPbj6Y&m<9v-26dKzxYM#n?*L8D*;&Tg|pa z*~N@q!tRT*HH=-xjzrlNj9tl|j(Y;#N)eGRi>>{`ZN;@FP^2!H?x zfB*=900@8p2!H?xfB*=9fJZ>>_uK#ZH7r6K`-pSvI!^>=AOHd&00JNY0w4eaAOHd& z00JNY0%th^wckI>-GKQZ00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd& n00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0wD0eg24X=5qgKQ literal 0 HcmV?d00001 diff --git a/thief2.v11.suo b/thief2.v11.suo new file mode 100644 index 0000000000000000000000000000000000000000..5ebb46d7fbeeb87747d3d94f19a7d3c929830617 GIT binary patch literal 46592 zcmeI53wTx4mB$Yd5foH>%lJS=ixOg?;`h2zEt79GgtRu62XXVJ|5MdwAKJ7Tu6ZXC5 zo_)?)>#Y6XYwfl6+J`5f820K_w-0~K3vH9U0p8~u2YUmJUK#J`CZTkvI;J<}e+V5}M|4#|b^19?N?~U+ky-xY=_Lk6r{H+5_q;Fr8tL`#w~JKn zBn3Xc>^$@MZ21w$>Ug2s>9xp{FY+3Mmrf~dJ_kkKOuw#EezkaY!c&viA^V$iG z>ZDAOGF8enDbuCQkWw$DLCP^wj+HV~%5hSVCv6I@kkMTEK3>WRQohl9Ob-9A+!_UA z3*||`e6F_-WCVrHa->Ge=_27`U;6SOeQZYx{>=yL>D0+y zR*somOxTY8H(5wO)jN3c*L@Upc{==(YnU&xj|&p!N1+J6)MC8F);3m4g~kr!PV zum6Rgzd@e2L#Q$iH2dV2wL+oL$97-`Y@Z)}-Prq7VfuaJ&*Y@{!rrfPp^u$`HrwX4 zegDE{1nnP;Kfv8Wku^__E}ZS_oBTFfADh*`ANCE~W=kKNHmg_vKo=_Ag1RQ5ALy8z z=s+DAWdwtHu}|~`&g64bYm68A_}$oSTl%K{t&#gS3(^@`aA#A}Go=ojfCl`so>(mO zhX`%P4Yu^L+q+9)+Zz2~EEZ^gy<+pvBB9T{pv|^Mip(++Tk{y>yKdirW+hRM4q4V7UM2k`iz}= z)sN7`(&prEt~_T(MxkLY0!n>CRo1=ac&ikg$*fF~N zP5M*isat&7*!!$-Q|BWBZWs}5Yl}-iB~RWg)|U3i;$VB~d*!h;+y{JNe~^2y1;@Ac z?dxj>_Ofj*??&OGN1i(Wg+JCUnqg~wK>B}V`lkHn3f@M9xKPgQKE?m*hbqOtKn6Bf zp)Y$MU&itDea4xcerYo_e~ldJ-o_0D|B;`czJk7HOG#UIN&6$^Zuz#gJ9;&CCpvxP zg>S_c__=}qJ6lGc*ucDR6--N`=Z8PH=lQuuV1L8++n(P6_HEmLduVL!ny)f_`l4B| z<6txF|1-YD&iCd2W6$=Gf*;`8|A)7}{C|^Y_REAe-`n#4!`D^Ibtx$}{y*3D<^PB8 zDW`p9wiBKpy0iV;$SpKjPW1U)i5V12+;=ewD8yDxrw z*3#i^^>-E?^>6RIG37k!N~M$!J9CG-Ry|#R&Bp}=OMm~&Q+F-P4L)n+_|%$7dkp{A z_onZ1L-W8r=hd%GpYzhv7bfrgcqXzob*=rf!|!;IQ71#SH1DuRa2ikZT@+O z{JCLJ_2myr$o`mfx>>FeJ8UiO`R-#lgcr-P2G_;6tTKW*s0wDx;@UOe`V0gZ)kG)=w#zS~B9 z*s<)PvrZn|_~5te8?G5YW5v2RuA8!7{jSG9@aUAu_q1I*sJQT+HEUk}_6Zm5_Gaz( zzfrdAmsfmk?9dgjoqXecuTNe3@~AzYcI-6020y}I(Pb2k3{9&3gV8+q}ypJh{5UUSu&GY0KheBA9dmwc=LO_SH$ z^5FV;Q|8UQde+=ab6v%?7acKu<69eUJ@Jmt-(0@q!Fx}+Vf^p`4-Z{7`t<`Ee)8Of zpG-dQsM_*ji*{P~{H-gm`a$F8(^uSn&S9N(t4=%Uid}D5aKS67)xVzgA9r82V95Q4 zZn){qQx0yp`Nj)Yy}oS2J?q|GbjzeAr%t}N_c@Aob%~-?rkgn^FdG6JoYaitgE}%`{^xnx*odnTkH3F{Mp41 zrSBX3YU8rA@*lnT(WU=hIN+Tb=T)apx#Jfd=iK@Dj92zr)p5){mz+e}Hbn?n$a~~f4_4`t15Bp%l_(z{S_6HsB zuU)hB+|2v?uX$(BvwqlcQS~8bp3?Bpq2azZ<@udIDIHqgaQ*Ms-+$5(k2a$WivRiZ zyVJ+7tv&CWId{%|WaV{czY5FWtP8iDSr={>vo74n%(}4r&ARZjnswoRXx4?F*{ln< zk69P)D`s67XJ%a(!)9F=KW1IHFPU{=J!IB}b(&ch)*ohF7<*=2SZ|qiVVz^vh5L(H z7uH2)UAW(vb>Ti?)`jtI)`fM2Sr^umW?i_?nRQ|PXV!&vrCAs5w`N^fXPR|k`(W0E zb(vWgwnJuJ*an$(VS8!Tg>8db7uM@$U04U3bz%K$)`e}YSr@h|W?k5Znss6OY1W0u z0%l!UZ<}>t8(`LPc{<+4}n z@70JmRU>=Va!!SuIYwq-Yvo9V{4SN4W`)#L$#=>-OFV=YX(Nq#1ayz}XMaqpM?0rF zOEAJ*9WazsE*mA$NRX!64Bky{Cbd08wo*yVo(J~qw8M3DzG z>u%*?@?j?nMP<2Qtwyj}DXmx~XdEMZH9q#hXO+~{`BV>E2RdywQ{`JnyU5%msG>} zQ{`vh7n0<~uKl%7y5z&epuIe_FC@i>oh%fU719T41!0wf#S+;c9_2StXjd!ms66ne3w}$4YIn)KprdQmHaV(JR3?8oENLRrx)j zT9k^cD+_$H{)FTxmO6QB=C58W)vG@?zH# zib|J!#6e|JeAvk%(3RMK@W^--FK(=$t=8AZ<^Bi(4OuOF)l!eHWXxM8XO#Jfi(N}7DqZps z2bD?jVJ8bkC3dt<(53hz;+2*^9YYeOs`2rO_cK=Z$N1>P?_!)ud|;gK^HfCCl`g5q zMP-t_*tLYB(j^~pP?;1TcCrX8IMFELOJfCR_}f@*Y&yD%bplNW2|z zhXrT;im@h`~6rAw-DQJEw!b}gZ(bjgQ_hN$Dpr1-Ftg`$!?i%SM-?HHl|3zex-o4NF!)R9)$kYFtz%$%|b}C@Nj@ z5eJn?@nI(mMJ3)fksk6(boRYckftL{js0M^Q*wrC%_`r1*T}C*!E&kpT_PBbX2D%j zjf=`8d9iB=MWstV;-E4qKI~)>ppuLbGCgVpnOJbV7yK72c(LFOR5HI#9Ft?@Nd++@ zbShETsI%|nTe+edAC<}RV%HJ@D&6rB50%OAVJ8bkCH5C9O#}#?M?{j$C-ruST{1V0 zt|S)`3(o8~b3e?5lih@EuZ^fHT~dvU$|QNQYY9cAOFrVDGATanWTB{J&PHbu(Uh8t zL{1V|Bli&d!zIFP8N#FV!;^RH(qv1P{uqsaZ8P&GqXsh5ZX{ZAao;H&1pHSR{pT(WOGE*l`g5q zMP-t_*tLYB(j^~pP?;1TcCt`ZGIxVU1YcxI5+^SgWMa#);9~`Yj4R2B2cKw6)`6fa z@ybCnW6Nl$bV)TXDwE{Jt|b(eF8PRq%B1+PlZB#^RT=0(@_Q=AAJiLx_aiZ9OWWKstzFx$(>)bdqj=FA$taUPlSi^yxrzW}&&e{)GRO6yDNnY$)BCz1@WD*CJ zF6CkJVJ8bkCEhj`n>Q)YYclR#J06%sC~#zke4 zyx6sbqS7TFCK{qUA3Su>i8Uwp5^o28 zJi52zj%r*~>KZ;Wp7G@3Ng&LNT}uSI(w$7=pwgv0Og`*np{N8`j2(%I6X_w7Em+%& zU&ES9opEIJs2&hDoRvPhVuw3K9ap-f8b*S>ZcsEN$%|b}xaY$}gS|X-6}n4#n0(mD zLQzR>2AM(RqU-E8@k&ODAdoyt;z7**Fq$Om7oABxDtl}Ykq*AjsRcPEoLsB|e0 zlMg#tC@RSnBD0rRxW2zAc-J8ooV;|6mEhyB$1D)zPhu$OSTGD;qv=YQRO6yDNnY$) zLQ(0G4-*Yhy`7}^u#-iAN-VL)^NH9IC&$;(aV1BH7O}<=EeR^|d)UW*Yat6bDk|Mk zjgQLYc(H4V0G00eh=FP8Nzv=4zM;XY~z!I9McduHKHuE+gUY1%u#-h#!C7<53=MH0*4yg)sF}wh21L$ZuxwyRO6yDNnY$)BCz1@WD*CJF6CkJVJ8bkCI34M793xP*dwS6)|C-O z=WQ*ZQr}WZMv>+M^Uf@CE?G@ZL_HcRT~dvU$|QNQYY9cAOFm3AMD=!(;=@iBib`^K znc3FWVpwpU1y>7><>nag`sMvs%!5-;+?}x|V^MN|qmCavfZNTN|#jQqB2Qd z>{>!m>5`8)s7#6vJ6R|yi8_KxT~VePzIfF-uH^mG;1f>uf0)2O$2VsbN`5f!fx*&8 zL#0cqaZ#BhFLo`VsC3Ck98@O7hn*}GmBb^Ni(N}7DqZps2bD?jVJ8bkrM`sozZlqOR8~EnItcEEupA%$wwSiCdG%HEP`<*^Nqoq2gqb& zMJ*9>P^s?$)W{ICwD>*X5}%xRy6_H5`c~Ar9af&Zq8b;KN%CUX62Z9AolN4O(xp61 zKI~+nsH_nDX_hZ5YMEWs+zWjJHCdNBx5G?0e!0HSh4>KJq0Cic=c7i3TvCmT$|QNQ zYY9cAOFm3AM2!q3#fP0N0#u?A$z{Xy)?79Hzb(*}j5P6p(2c?Wc0!bhw`+h?MwDb+ zM*aVG^j$V?sK!U7I|+n&v1^F{mG1b6hstF5u#-hFu7n5H-+(%ual|HrMY4g&p~Tx^ zv;k&`p7X!wah3kx6JR>3w}XatMKz2Bd)*L>=aS>at|i>_5eJnn+s5R>P8Nzv=Df!V zCW)7m&kGjOglfU@Yd|V_cc@o`um4(?P}25)pBhKbfBR~P%sn})FX*l*(K(NO7< zYFtz%$%|b}C@Nj@VWJ@_DwE>FP8K_Pp6I`3FYmQ`r+XREcdcHV9GmD3@&?Pd`DA)W z`qKZUZFhN?q5cE)^E~+%b=!_hwjj}eizA*F=U5-N+vcGiMUHjJFES{KL|4s|v(oa(wR!o@$#=7Sd){e@ z-TQQ*&@5bZ3t#Qte4kpYGipup99geJWWaL-&lCLinmC!`SGxIWg#4K~Ua+-L|r zFVoQ8+})MyYRwnTZO`>IWoPGmTH3pc8Z){4@$H>0U5g4w%*}M?+PgX@mXs6~^H(?` z-ILAtbY~`ZW_t47P1(W`GkfM|+nZ-(mNa%P$aGGeUtHE&(OTJBQqodU+*H;yWPp%b zxJ^<;(>n8+?$)N}OwI+>9eC0S+oqcC>dbd{WwV*?qFFtivora8duLm&rYYZqt{6FC zTCT1=o9R7X-JEYfJu_*+$tS0pnit54b?upK%OMlwN@P~uDo>E=Y0tKVPdR8pV^eoq zCOkT*sovpwnbCBIG^dvwa;(Qw&#}=)h^C7_v8f% z!86dTgH(a<@R>j>{vBzu9Zzq{_GC^z*&D?DgKaR4F^mt64jr&_P+|N1SH!=M#HwwJ z+d!g-cu7{;4jA&lqXmZ5*(?~#1$DDC*-Udjvjx=tqEH&x&qsi-RR+W9Fg_S>4c*CX uqakv{KS{o~XZs+{IBom4)rBR;T|DYHzZ?Bp=@oZw_|ZPwf2XhJmHz`W!VTvD literal 0 HcmV?d00001 From 236334055a99d4e62ef57bcf3bbcef4f30faad93 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 4 Jul 2024 22:58:34 +0300 Subject: [PATCH 19/35] update .gitignore --- .gitignore | 3 +++ thief2.sdf | Bin 327680 -> 0 bytes thief2.v11.suo | Bin 46592 -> 0 bytes 3 files changed, 3 insertions(+) delete mode 100644 thief2.sdf delete mode 100644 thief2.v11.suo diff --git a/.gitignore b/.gitignore index 4025253..cabc2c4 100644 --- a/.gitignore +++ b/.gitignore @@ -44,5 +44,8 @@ Release *.tlog *.pdb *.rsp +*.sdf +*.suo +ipch/ redist \ No newline at end of file diff --git a/thief2.sdf b/thief2.sdf deleted file mode 100644 index b55e0bad98f7fd656c6328d685414a88295a94ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 327680 zcmeI537i~9b^mK>W@l!v*+a)lE6LJY)-Bn)vgAWPv@1)tj1AIaJ2rR0vN`@TA7cDJAY-G6+P(JLa}#H;oSd49K(q4H2m?~cL$SI-`O0DN6C2c&lklJFAxBM7dHX< zk5*sYF2Xwy009sH0T2KI5CDNQoWS6_e={n+|1UUpMvLp@nb@bVmS?p6r{iMU|8HQi z4LehHsn@33Qyq!*sgrp zbiO2?nomLtNLU;sNbzr7C5DI&uL&_Rp^ZKb){ueprbQnM=3N};GL z7YcISv)&-&_~qSEwN9a0H-w#QrtAgpPrWHr&JA(s4%J9`hN`G#D7#Ip9h;=DI=v<; z*R_Y5joVVFdS!MU-JIo7)9X+ojY1^kf>dLumFm`&N6G)V>#Gc}i`dPkGNLo^)cio{ zS){tnwoVsTmdz2jZOioAy8c>f_VIAvaa*|W7HQY6rLohgd{RT_fw#@_5%4v$b}Bi? zHZCl*AoYGX1T#o*wQh5iG8)1?ShHCeg7u1wXE??OSCt2(8rSm)zYz%s{SBp-ABb77wK#{RY3!aR5nAD z)4i{ua*Ii*oON-!f1z$&lrom-b3)Lc7ztdgm#C+V4jV8HcchCZ8tVF-7;Kc|+z04f z5b2O6rbzti3Klid{a(HP2Fkd$l0}UqaFbr5mNI-6Bc*BsuqB~SxRe}mG39E`y z_N?X7R~sQ08LBhYhzq?_Bt?e6Bz%}p%J<23E4ooRA8V<|im+nwh0C0MRD-jAA>c~u zG`ba@H8}BWm!Q--&4hfUPpv7%yW(|#Yw8eKP0tK)&`bzI;d}*OlF3rn)y|&D}(MglM=IgsQc3iW6{mJf=mmgho z?2?nKI=W7t-?8G*l9T7{o!@cJ$@ZR^T{Ak`dZ$>8Ee(h2x@sfIp2W_Y&9tXq@vW&t zHT3v(|x z2!H?xfB*=900@A<3rXPJ4@T~d$GX{NjuGPT|7Tmjkyi`F`*^8TV&0awR$MVwQ~k#S zR--k8`BOT5!|uYSt+!?SiUpP*9m!`$i@B`*D+ofVHMhG|n#Wunv~Zs5nIQDjE6FT+ zKVjZHTlH2mJ=IW8nx5gzP*zmIOv+*rQWjjQC)u;~3CW45aqCaYT9`j+%5KjLj%nIT zrM1rpWf|=?0ordC9NsUpOmJ;_L0$|-AaY1(k2X-}C|jsMM>E9NH>OBu%D&Ya`i5=D`RtF~RNfF~DX8kmnCcfV zoj|{+)hzVFQMO-1Ms2=z6Y3Xpm_PaYMc+t&Hk~VGhtfN8!~Ny^$8_=Or)Q#VcSH`o z<=Sj>s3irJ<@#kkram%b;(eq!Gy(+mh5L#&0M@xg#CON)u@6O@>@ynbVPd{pTE?qoIp>L;tZ2 zTf^>lQ$Sxi6S`IP9{lIhm-G;M4b|&QR;l#(xHg%0RKs4cRK$BJbCPwrwVvI=f-Vk( zDLYNTFq%2D1vd;P0*Q!Aa7FhD+vtV~4FJ=bKlug#S^(HfJEc;t=d^xt9%I`>J-1xEet7_Yr?p2_R zFRP}R3HIKau~x0YtwqdEt}1(tCIjYlYIRFox*-g#6qn08W#1a9HF-Toijliw7qFb| za+6ZztP@=uShp(s{Q9p~TDQj6e|>9>3#tJtOw+-twZ<}LC)cU5onk3&J0+V=C_`{D z4V9hBeF-k~mI`-Of-CIsEj3gx45_u}SW&G9XuYFlB1;Xi1Q%UNygZA`bxy=c_ZF$44L~ILfU;QuDGWeGD;y3%n z@ACM5nMwX;N3Y10zZDX(#l)|xs9)t{cGd^vuTSi!-_D_5%#*TyMYsY15C8!X009sH z0T2KI5C8!X009s5J@^M?N)NN8kT{+)=K++unGZzyCj7 z^`CBr^^^Gh|K((?_`eI{h!+Tez>AxJ`X4JVZZF{-2!H?xfB*=900@A~l!sJG9-5lup}AQeT3Y0xwN)ObOp%AFQ{`dWG!3m00ck)1V8`;KmY_l00hoB0^RLT z&fGHd=^56H<{1auI@^v+-#mSMTAu#-_Og)lBMozoY(k?hVF(Z>$lWDU1!xb*Bz|wtUZ$4oE%T&6D)CGd|vz$HQhB&#ZV#-*p^{(*ONGhy5n#Uagj)9udHpwN_*= z6mR3DQi(D5)**34PZy~EDFRlbMgQ)=m(uAQb{95ny)D~UEU>K*EXD7^mux}-;dgf0`Nv>a3AUq4|ximt0f=}{RdW5#ni}W-y ze^Pq3XA0Y;yh+n#oHPYZSDKnbYAAy=O=13|H04J}1jlsHvw0rDE23z*q#xot?lO`gqW{-iv!kLlcS-{4q(Hl5ED z14uQ+JvF2_u2)RwN^vl#Qj8S0F@Fju9?2JTBg27)sp-5bPCAL9@1=AG!>e?jL!D4h zN@spBQydr>9jeaV4GB^mY?Dg0+jDfo$laODpF*lb4wp)6pJAS!jdtJHt2Lj~kRe~9 z-A-pRS?4i3xmtImom0_t^S&!ltL!+X(vgxCapQNbS)IylCC>wm%rRgoyWLG@16a2z z=|yh6Q}IieFO58SSZPs5C9kgSqgPtD#T!qp0Mkv?FcqqFrt_Ih)|Jdo%B8WLE>mw< zNXs5u;g&GmL|Z&XrowAVxSbJgVc2!-{cftlG;Tm2bw^?k==F{<=5V-;#AmWsIvfrf zR^4e%gk@Z7>bF!A7NOE*M7}%y+FE5@WnIstpx%`};Fn!3voT5z}yy;2XT?T-FF&FI<; zHiIo^yWC`OP4*E}qf<`3Yyx9|m=nb0Dqe2;&>CA{O%=JpZfw)T#@ls--)T+dUkyxQ zzBScAZZI2|xU>}&{Y$8cuBhTxElsC-vQ-3E9h#Q(#Me`CtC{(et)-Y7$`*>5A@P5$ z%!|Yfrv+88ZA9h5v0{auHI!so>LvbHirTb5IM1JLUy-)pO54^Zo8hPwa>jVyS}b491SLv) z>xQ`1%4AX#l>?Ec9I4V-hq>pXv^%|MtFWEoM)_A8^^8Ci$w{GjAscm*$bQ+WOs|1poMB z3BL5%2EO6ZIRE~?#`$gk5a;~OasI9+;(XZ`;{30F6z9G4^Q&B(|4D6vKXgkYf8sNZ z{Eko8^4705@znS0`TVI#{=rp^{L#JyU-`)d|Lb)LzTs^N{?ws3-w{dh2ptbtalU9? zg0nnlE8jP(riK3h-#biBAumKA!g@kudPoQvAOHd&00JNY0w4eaAOHd&00JOzh7tJE zzy&p}u`TSeGt4fS0|Fob0w4eaAOHd&00JNY0w4eaATW6ZZu`%knklsZ|K{XXiJCwF z1V8`;KmY_l00ck)1V8`;KmY{JFalkF^wOHCwEzF%8D1pyEM z0T2KI5C8!X009sH0T2Lz>Ir;!>ayR?jCHd+o&A3_#@Otq|5H}5klw9QY3(zNB~^{Z zQc0bbKZ?3a&Wl-bYbuk;I+xjLAUBvTu(6$Kd6FK^3}pjXs&4OB?bkb5FI&De^59{0 zUmeY#UL@#toZB*8t0t)>{`jW>C8#iVyly_XSQ<#I~?conbAUa zl;wA%?X!Y&WX>f^TFOavw5xUuJVLx(m4D)%*)oCmb_!nLMF!4fGuaBZ+fBBCxm}Kd zgW1f09fG*4$g|{hU}xjhHW+gw@*x}htg!U~XWUDx(Q0S@luqBUyRd2NZP~tJf%T0H z59GGl4$49j=G^X5X)$xP>|t!XXM|ICjcn>CJOHjvIw7@f%%6OkoQqt4S)EpdbOwW{ zbh@1^pmQ4YC!bCc&2$BgcXC!A`iqq&X+wE0-8SvCZJ);6P<}Aimn)Wa@~$YUbTK>5 zD3xy115Wy}w)sOinjOfFW{3N-Wp&;iBb_yRopi2r27ya43T8z&`$mTH#I}4a@2w$~ z@iHon4am@JePor&biQx9tk=|R_r*!A7}@lf@-#?Y%8=T*%%6N}v%BnorZa^?c4+J1 zZduCJ-RZ^h%?Z};%>|ADwXAzCW91u@zn`}IBbyuU8yxG;(x6xjxU8vtOOn*q>i*KX zQd_P;`TNW?zuJ*}F*h69~=TG}mZdz+|#|nVo!)X|~g^)kUsfj#8or zpISngE5lMM9VuB6w^=_R{V4l3JKQR$NeEkSW*>2rZe2CDbSv;)Q;!((u6N8b&)cpG zKI6R_wONAM^EQpb`ux3iT${fSRueU$QkgDB^hHc2tH;`8-OP6Q+X+qMIu~_8(W3dY z%pIEQ?K=e#Rp*p30~_JA8&7ST|8v(qArX4bF~(DPaT&YEO}cdztToxS-cf0enc28X zF>`$M#p(mkB~}ZVOx6|FwbmxqS2mNSiLoc`IDwf#jBjYk8oQ1>D@#Ksl6I&g$cfPKGm@OsT^Yz%dc`9Y^%V5?l=1y?ik`&M6sSGnJZtcxK)%xIXFN-9P=h0PWJl#w8`Il! z!+}TfX-`i3N)zb~K3hgT0mk@|AGNCr4`nIt&IdZ`CEf#O{Qx$Rf;@b6m4!&Z6Qds7}7pV34fR(cXlp)k^yE@pR?hx$Y- zshr|zlV?h0@Bu&aCaLs4e{ZfHOxw@?>_BF0u$aC*GdNbB@i(RrT0o)dN9zLl%8;eZpQJd9{&9GgZwrU%q19#;qQpQ9P& zMitGBZ%-#0Z2@(P#>POtGGj6Gr&G`f4>Ey=7JjdqN2&?s-a`xPt=UW_YXvc|s=l&LzhJFLJDdb+FZJubVW-ElR_Y z{ql4@mxh_3O2l*8#LH`QAPB+wTj)x2a)P?V5ZRTdZ5v`21W`fJAN8xc2kl zL*{2%Fe+c&P?ZJCV z*c-pQ-qop|wn$I&HLhf|M_~W*xjbz#xMI`vxRgUrCDfGuN=(msBd}c(kWNGuGS5vq zqox{MlWI!C4+_*Cf%t1qj}G=CX;-Tr9qd!0E-EXt7lsGdscFymOw->~GXV?F-3CF* z7E)D|==rlRw{B%~9HZ@W3k@4G$8Yw5>&XOhS0`G5QA*?+TdOz@9?JI*hDLxLaOn&8*onc&CvCiu;V z68z`QRA*;`Gy3`A#}C9i==c9;gae|0;0OXB00JNY0w4eaAOHd&00JNY0w8df6FAuP zq4>G9|DTWj|5+YMm=6LV00JNY0w4eaAOHd&00JNY0_6#e-TblmeA@pn!~VZKB-{Z3 z5C8!X009sH0T2KI5C8!X0D-fdz^42EDt;dA|5sxFf0joQ=7RtTfB*=900@8p2!H?x zfB*=9KzRb^{q*tp0^0wt!T!HIB-{Z35C8!X009sH0T2KI5C8!X0D-fd!0#7+ExwTU z|Ld^-Kg%Nt^FaUvKmY_l00ck)1V8`;KmY_lpge&;+;i*K7SaAcukZh@b?jA6kr+Md zU;~S6*qKCoIDG z`Kq|!B#`$K@Yj+LcC9HH5?+xx-CUV^h1a(j9qB35)qI6#YYh~+Lo748)h=lZ{_EQnB zFRQ}SsPGkfo188(Hd1%`py+^9Ms)CAIkqe(l{E0kraM)LIk#lS6p`VFp>#CUEzQ6( z-bn*hkyaX_>dFmKJ|_)A4msYWBtW*YmH-KLN@ zbxU7$dQDWWYYz>K?pR3GE3@n9<}8nzUWXEC6e1xPq#8r5RJX2t+QD@!?qTtUc^7ox zrh_9m<0xaMQ+=0u6jgQ`Wv}*XQrS}|dyZ|ocT?I>UX63dr-Smm@~ZL{8XcO;O;iT= z45G$*o2cGpL8GfEOqJ=KElMp?-ps-u4Sj6PUVwYqxF1H<$X7)24!43m2{%+YoOA^1+<<}f-^{P zweEG4G8)3G1I=ck($4NfK%5`$pg83vU-jnx*`7ABhCaVj3y zZh6G)^@#5lmD5{G4VCTEQN%=sdCZNJ)ni8{s7JY1L%neWixCXt%1B0?Zq^Z-a^1g{ zs+cd9sO@CG5Zp-N>`mom**dzpY@?h=I%Gy%Nb6oEM8A#2Ph`{C~~zFP9doF3&gHmv^l9-qK9faRoW3Arl*N)<;6^Kp@%0S z!gJ~+$qZ3W_r8Y8Ev5!k&bm0=zfiX>N*T*4HN6-KT&$O!qw=v=h_jtITzx!UX4)fFsiqWisi{SB0HZ6%8uN#G{EL@j0bEXvE?S1X1wX+s-f zS|oRnWQbxuOR%e?$JdGNZO|#pNOg{s^=~`>wc}SUzl@wX`On9HcKjbt{`B}yj{U>Y zr;h&c@DF;v*Y(}ZcTWEO@nbDd9{NVt6UYDV*w+q!<>;3(kM(}B=LH@9%z3$Nequ+WYq7Z$18}hu?Jcp5t%W`TCQ)JBo)#dv^8= z?%dupu(SW2XZHTnM@AHHHS?feRl~fshlt9(m!vlS!K>dDW>R~Aw7oy=_oDkV7Nm8pp$~VxBMR}@H z^aOj_5Pjx=V{fAKrxVLLXR?B11SSe3(zl_sPC5c1PuWtfe9=!ir;*J!c=);Cuq2 zb;;&~i|~itva}ca#&YlszXLv-(pkki#V!#L`zEo*P9*XzeQlKaJcA zuWvcEfp!^e+E+@snIt#UJikn*TW#&+#(YYmfv7UA;)e2WhPW`VlH0^BJ$mgTBRDBe zrA+FIUiDLil#@Xp#EInyHEd~Zf@W3os##YPCn;(qVimLB9ek4_bAM{NY%`*J=_RJo zP4jA6Ul30rsX5B;sp3MfBSIPG)v+$cNvgv?HPzFC(O&pD>tE?AjX8!EP)<}I+iJ@R znHJS`<%Dfp^wyRvC#tPzwPxQ&jnll|7Jb*WpqWA?+^#=eTScu5^L>y#fZ$~MHw zs7d%_GDe^$^2wxauD&vV9v}2cM{3A|34Ah{An`7H|2;`oQ1tyRtx{WPp*~*S_Q57) zs>^Bl&gV$}p{$wer@h5QKB;V>R;6tz$`qE`)Bu;FML?w$k!QO%yX`NTmjTm9jEx*FC|1m7MH7)EcFdt z)G_Vh$g|(~;h*orBPu*upUS1EXH@!B&c@^!61WdcM=~WXreqe*O5@j{nW!FC9J7^VqS^_I~on zM@~L`^h0|O9eZ!)J&|`Ed)uM69(vQ^y+`*Py1i?3=g{%(Pi{S$Y1tA*2pWH zZ{Bj_eZAeA?z=v7UF6!6*K}NSbp6S7hkAO}?!RL1Jxng!Go$F8U$PM?O^1d*_vGYjDinv?z|0r*rxU-Dh47?mWZ(t9* z$+PU#c61A;#fv^vab7A%&%55aw`uv($b*NKq&m9hs|Ip86c{tOC)B&>nfIy4?>rlA3;plQjp!FrRcqMYZqmG|V6w@q z^^Q6-VY6+O2n!e4IJIUEeq@T>3s!_(@%!psS&i0A=1=ML4Z91Qw%(TQD;AvS74n&3 zf=w?8c5Zj6w3xX{{+qGwS_7~vuaSN8gzkZTL%drJA+0u8Tag=J5pD4@X?-?Ap$#`o z0rEuD9T#MA=Z&Q;WX1oD;6Y0RH=KZQ=em;U)8(lGJ)qQP3hWU^ky?4)aSCk)wyy%8%sW0VsR ze#u5qD(O>3q|xNRmv?@!eaP-5484gx;-(3iY8t-00m|zIYSP#|$&-ddVePm#!AF{_ z37F`PuA$T{7c-fx_0~<+7FP6)X6|GZj)ylJ8SYKebQEcI4fSHFon2rIt8nLXcCVZC zu)6b+!Dv%N*E`zG(KB1;#a;u=?5SQvEjS@9vZK}+c1Cm6cS;k|bmmXK327iVm`x95 z^0JU@DE`?fGHv3sQEf=2tEHN$DAE?82{1SnsR__L71df(m_KPMhX-=oDolNmnVj_L zp%5^XzGfdz=fbKDO?|FDd7@9WfuVACH9b!>7jJ1@Ypr53S!re`R~wC!>fAp__Ki4h z+xN+!35W_eO=IUA$Nw@1@tekh7m*T{=h@fYr0kuLL578C#E{1gc{e&HnLB1M?zXU= z>vdiKTAU^Zxi)t}d5h!7Jg-myh`d~B1a&SumtDl}bdw8;h9Y(D3o`qk8iy<~hidN4 z5B5&KlNTD@o6F|13)$=4q+AlygE}YoRBttfcfF&>97;3uvZ18kvN45jpR`6e@|BN`g%fBhuM=YF%1cmJW0zv_v4-uB*B{_B5<^ViiSc-@)= zzyHz%|I1rayz{T>_)`PT{CHa<|LX+_{*ny|{=M}HzNJ6G|L;G=`D^iCDdoB2m~CfFszC*#ZL_x}ef2QKU`azFqCKmY_l00ck)1V8`;KmY_l00hn&0?&Tq z5Ao%+|KExI|5+0=7zzR)00JNY0w4eaAOHd&00JNY0uv?hgGC(=ub{vGe=YX^RiP8l zLjbC(P(cU;KmY_l00ck)1V8`;KmY_l;7lSg)Rj1&zW;v^o7yueDzF6vKmY_l00ck) z1V8`;KmY_l00btLz*oP1MdAY5|9=eo|4HSF%0K`FKmY_l00ck)1V8`;KmY_l;7lU$ z?Y9g++)2Ox|9R~Hs|rgK{r-RWA3au86ha^X0w4eaAOHd&00JNY0w4eaAn<|_SpCIU zCA#SQ|Nn#i{|goaC6)BM%-9+87CD$ZMw_dG1MAYemLF@ity6l^9dE zBJ0EzV;5EbPxY)uYaa8bboz$fg-u&;%k~uuY-^^FP4^9E3Wan&GnyTyEb$V`t-0N$ z(qi`?_(hg5w%s*FO3_;lOVaxZ-4S(*YM5dzVE$y#XJ?J{XVbZ2b|{_emlc>SSQa4* zf}g!83xpk^7g?}~`IEr{+w*jv(S}lK?K4bzDQb_bvO^HkIrmaI#qBPA=M=tfri912}r9BzV+pLeh)+!XeRJuh3k zRZsBRTf~rey<@JqD=HWLK6y2I{f%0%?278>a9TUAwTCOJX%9Y?#OX37lhtPxt=F@+ zn|k5Ej;h)N%k8R8F2BQTGX>Gf+}2J#-oQ}MaoYuRdtGFW3V|P=y1K;JE`+z6*n8Y$ zXcyJ`VX}3-qum^Dv%!_(ZHn{SYUAvxqc~r|WU{tdyR0{``>T($X+$y;GD%j7wW+@d ze5P3U_}Z-sv3tDK7;E8iFZ**hRUK=SCnjr8N3??z?M-&H*MvQEy$_twL_3H1lW(FO z$PH%Gh1|B`OmS>9TYi=$?k1R=)e-98;b4oVd?IR|SevbB%%6fv zcjSiqB_!Fj#A0Hex0u+-Sr60uppdL*-E+$?CYr5w=1)P5E?!Sz3@KI*1`Wn%sf zWciIXjj!&IrbSH6vAxFSZn!N8H}rUWb)I^TeR(xe6Dr+G3B)oclXbQAa_bg0$O2w7 znqUK23WS(b%iW@(Ros#@s63g_);?gW2iae}Y9 zCBZ-caDpFssEL2)F8bM<;$OV8m4AIh6aQJXiEr*n@^8*d^4=#CoHf_5uRZaen=hjO z|Nrmi;mu_F|LVNR=Bq-D_kT4II1d6K00JNY0w4eaAOHd&00JOzRuK4)zkgriV*366 zg#LNhSz$Sh1OX5L0T2KI5C8!X009sH0T2KI5U7^G7gqj7;u6~bw_^WaEi%Y~00@8p z2!H?xfB*=900@8p2!Oy@N8s*#pH5s#`~TV4|DScSgTWvG0w4eaAOHd&00JNY0w4ea zAW$uVr+z(t^BVg5|Hatj=1+y)Lt94%3#_<1pOrFFQ>ipwvLfn_>mz-p z%DlX_vhGE+Br?<`Wfq1CHt#Vs4(rmAGB>x&ZHf8JXm+?Ltcz4` zkVkZDc06}$UdL3Lur;TtS@<{)DdIX^@4UyzSu~2}S~7SxoEgeeG*#`!fcp>+D^X9m zepbnlT}-8k81h``(ugaEU16EmBz&FDM>p^HTX#sDuY0a^Wv4qucUn8H_5PjDqxV~j ztt+jUv8`o$zt+7bZ#3{Vj>2>2sG7zu*ZiQlCXUagap(=$)Hv8U%~oE!iM-K{$yMP- z5Ns#v+G?~~nLnk|H|#EK+Im~IuUKHC*@1$Tl@owiMJ)DK5w|n8U2C*Uc z)mTl;pQHx6m&r+;YBA~B6(L* zoQO92ba<-#OQS{`9O;wISBROMdTo@P3I;lcqf}@~9?IV^r!s z5uF*xmzRXEj`@?sH<%j^toF1y)-u)P<*g6;${49>V{L4imZTc$QsU^$veLC~)dl>q zk?xjCzTUmp(`h=ZWXBy$r3u)v-qAA2%Prr?{|4p0$s@)#7}*9_(mtQuo-mPx%U#di z47H5C-R>PK#1+k$Y_eu}$OVBHn!sh3H}dh9H1d&(wJv&;+jSP2no!{BnxvEp#bneBhe5Sblx;3xv z&y4PnZ`t8(^qkjM7q{oK11rxj^bcs#Da(Bfdm%kE(l2Wg_wfP&5C8!X009sH0T2KI z5C8!X009t~YyvMi65+GQIcIeI&W}33a}DkP&v*9!NwNQb+TQ<*UkUi_%Ex~B=_`kB zz3y$V*>}}v9+>wjX4P0%U2xU1WqtX)FiZ-q4hcoAYu8_&>mPJQt_+DJt(Rttnf^>M zGt@7{@B#r4009sH0T2KI5C8!X009sH0T7r(0vq$3FX*KG|7Om=`^xv;w2}7zw>kU& zI@85^cwDR3oX28rzO*pMqw zV-Uy<7qg=SnZB$m6*owY4euBpxnnrppY8KLjz|~;hq6Okv!m&OvEja=ZdTvMfT$`6CSW<$Ac+2QPHt}op;GE7Y>LjiXwwHU;=W(wJ~zjd}6 z#D)oYA+NWaDV3zsnZaDfYwuGHvSWqZ@V0cg-f3lJeXVi2K`hh^+YCatXGU|Gt%F{( zm|+mg6pN#|tz%l_nOR9H+os*yc$-!if zK`K8wlFyD7ce_=cV-U*TuDAEO28sUcV0N3{h2|NAvb*wwxxQR6Jwm_qG@9%8$aWZ{ zhcbPmBQ&rK(62nX)}32caBP@FUAg%Nx%>#pq;tc4gJYWN^U6yOV;+H$Z2i7T2xkUQ1^IoS+V?RX4_E4)w`suU~WK1v$TSoTiLP-LO#&T%L--(3trq- zR1nK~VLQLP*l@olcY#4pjF`Hgod%h~%+{4&xGB%%ebGCr7g)Gn6V#b!RgPbj6Y&m<9v-26dKzxYM#n?*L8D*;&Tg|pa z*~N@q!tRT*HH=-xjzrlNj9tl|j(Y;#N)eGRi>>{`ZN;@FP^2!H?x zfB*=900@8p2!H?xfB*=9fJZ>>_uK#ZH7r6K`-pSvI!^>=AOHd&00JNY0w4eaAOHd& z00JNY0%th^wckI>-GKQZ00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd& n00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0wD0eg24X=5qgKQ diff --git a/thief2.v11.suo b/thief2.v11.suo deleted file mode 100644 index 5ebb46d7fbeeb87747d3d94f19a7d3c929830617..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46592 zcmeI53wTx4mB$Yd5foH>%lJS=ixOg?;`h2zEt79GgtRu62XXVJ|5MdwAKJ7Tu6ZXC5 zo_)?)>#Y6XYwfl6+J`5f820K_w-0~K3vH9U0p8~u2YUmJUK#J`CZTkvI;J<}e+V5}M|4#|b^19?N?~U+ky-xY=_Lk6r{H+5_q;Fr8tL`#w~JKn zBn3Xc>^$@MZ21w$>Ug2s>9xp{FY+3Mmrf~dJ_kkKOuw#EezkaY!c&viA^V$iG z>ZDAOGF8enDbuCQkWw$DLCP^wj+HV~%5hSVCv6I@kkMTEK3>WRQohl9Ob-9A+!_UA z3*||`e6F_-WCVrHa->Ge=_27`U;6SOeQZYx{>=yL>D0+y zR*somOxTY8H(5wO)jN3c*L@Upc{==(YnU&xj|&p!N1+J6)MC8F);3m4g~kr!PV zum6Rgzd@e2L#Q$iH2dV2wL+oL$97-`Y@Z)}-Prq7VfuaJ&*Y@{!rrfPp^u$`HrwX4 zegDE{1nnP;Kfv8Wku^__E}ZS_oBTFfADh*`ANCE~W=kKNHmg_vKo=_Ag1RQ5ALy8z z=s+DAWdwtHu}|~`&g64bYm68A_}$oSTl%K{t&#gS3(^@`aA#A}Go=ojfCl`so>(mO zhX`%P4Yu^L+q+9)+Zz2~EEZ^gy<+pvBB9T{pv|^Mip(++Tk{y>yKdirW+hRM4q4V7UM2k`iz}= z)sN7`(&prEt~_T(MxkLY0!n>CRo1=ac&ikg$*fF~N zP5M*isat&7*!!$-Q|BWBZWs}5Yl}-iB~RWg)|U3i;$VB~d*!h;+y{JNe~^2y1;@Ac z?dxj>_Ofj*??&OGN1i(Wg+JCUnqg~wK>B}V`lkHn3f@M9xKPgQKE?m*hbqOtKn6Bf zp)Y$MU&itDea4xcerYo_e~ldJ-o_0D|B;`czJk7HOG#UIN&6$^Zuz#gJ9;&CCpvxP zg>S_c__=}qJ6lGc*ucDR6--N`=Z8PH=lQuuV1L8++n(P6_HEmLduVL!ny)f_`l4B| z<6txF|1-YD&iCd2W6$=Gf*;`8|A)7}{C|^Y_REAe-`n#4!`D^Ibtx$}{y*3D<^PB8 zDW`p9wiBKpy0iV;$SpKjPW1U)i5V12+;=ewD8yDxrw z*3#i^^>-E?^>6RIG37k!N~M$!J9CG-Ry|#R&Bp}=OMm~&Q+F-P4L)n+_|%$7dkp{A z_onZ1L-W8r=hd%GpYzhv7bfrgcqXzob*=rf!|!;IQ71#SH1DuRa2ikZT@+O z{JCLJ_2myr$o`mfx>>FeJ8UiO`R-#lgcr-P2G_;6tTKW*s0wDx;@UOe`V0gZ)kG)=w#zS~B9 z*s<)PvrZn|_~5te8?G5YW5v2RuA8!7{jSG9@aUAu_q1I*sJQT+HEUk}_6Zm5_Gaz( zzfrdAmsfmk?9dgjoqXecuTNe3@~AzYcI-6020y}I(Pb2k3{9&3gV8+q}ypJh{5UUSu&GY0KheBA9dmwc=LO_SH$ z^5FV;Q|8UQde+=ab6v%?7acKu<69eUJ@Jmt-(0@q!Fx}+Vf^p`4-Z{7`t<`Ee)8Of zpG-dQsM_*ji*{P~{H-gm`a$F8(^uSn&S9N(t4=%Uid}D5aKS67)xVzgA9r82V95Q4 zZn){qQx0yp`Nj)Yy}oS2J?q|GbjzeAr%t}N_c@Aob%~-?rkgn^FdG6JoYaitgE}%`{^xnx*odnTkH3F{Mp41 zrSBX3YU8rA@*lnT(WU=hIN+Tb=T)apx#Jfd=iK@Dj92zr)p5){mz+e}Hbn?n$a~~f4_4`t15Bp%l_(z{S_6HsB zuU)hB+|2v?uX$(BvwqlcQS~8bp3?Bpq2azZ<@udIDIHqgaQ*Ms-+$5(k2a$WivRiZ zyVJ+7tv&CWId{%|WaV{czY5FWtP8iDSr={>vo74n%(}4r&ARZjnswoRXx4?F*{ln< zk69P)D`s67XJ%a(!)9F=KW1IHFPU{=J!IB}b(&ch)*ohF7<*=2SZ|qiVVz^vh5L(H z7uH2)UAW(vb>Ti?)`jtI)`fM2Sr^umW?i_?nRQ|PXV!&vrCAs5w`N^fXPR|k`(W0E zb(vWgwnJuJ*an$(VS8!Tg>8db7uM@$U04U3bz%K$)`e}YSr@h|W?k5Znss6OY1W0u z0%l!UZ<}>t8(`LPc{<+4}n z@70JmRU>=Va!!SuIYwq-Yvo9V{4SN4W`)#L$#=>-OFV=YX(Nq#1ayz}XMaqpM?0rF zOEAJ*9WazsE*mA$NRX!64Bky{Cbd08wo*yVo(J~qw8M3DzG z>u%*?@?j?nMP<2Qtwyj}DXmx~XdEMZH9q#hXO+~{`BV>E2RdywQ{`JnyU5%msG>} zQ{`vh7n0<~uKl%7y5z&epuIe_FC@i>oh%fU719T41!0wf#S+;c9_2StXjd!ms66ne3w}$4YIn)KprdQmHaV(JR3?8oENLRrx)j zT9k^cD+_$H{)FTxmO6QB=C58W)vG@?zH# zib|J!#6e|JeAvk%(3RMK@W^--FK(=$t=8AZ<^Bi(4OuOF)l!eHWXxM8XO#Jfi(N}7DqZps z2bD?jVJ8bkC3dt<(53hz;+2*^9YYeOs`2rO_cK=Z$N1>P?_!)ud|;gK^HfCCl`g5q zMP-t_*tLYB(j^~pP?;1TcCrX8IMFELOJfCR_}f@*Y&yD%bplNW2|z zhXrT;im@h`~6rAw-DQJEw!b}gZ(bjgQ_hN$Dpr1-Ftg`$!?i%SM-?HHl|3zex-o4NF!)R9)$kYFtz%$%|b}C@Nj@ z5eJn?@nI(mMJ3)fksk6(boRYckftL{js0M^Q*wrC%_`r1*T}C*!E&kpT_PBbX2D%j zjf=`8d9iB=MWstV;-E4qKI~)>ppuLbGCgVpnOJbV7yK72c(LFOR5HI#9Ft?@Nd++@ zbShETsI%|nTe+edAC<}RV%HJ@D&6rB50%OAVJ8bkCH5C9O#}#?M?{j$C-ruST{1V0 zt|S)`3(o8~b3e?5lih@EuZ^fHT~dvU$|QNQYY9cAOFrVDGATanWTB{J&PHbu(Uh8t zL{1V|Bli&d!zIFP8N#FV!;^RH(qv1P{uqsaZ8P&GqXsh5ZX{ZAao;H&1pHSR{pT(WOGE*l`g5q zMP-t_*tLYB(j^~pP?;1TcCt`ZGIxVU1YcxI5+^SgWMa#);9~`Yj4R2B2cKw6)`6fa z@ybCnW6Nl$bV)TXDwE{Jt|b(eF8PRq%B1+PlZB#^RT=0(@_Q=AAJiLx_aiZ9OWWKstzFx$(>)bdqj=FA$taUPlSi^yxrzW}&&e{)GRO6yDNnY$)BCz1@WD*CJ zF6CkJVJ8bkCEhj`n>Q)YYclR#J06%sC~#zke4 zyx6sbqS7TFCK{qUA3Su>i8Uwp5^o28 zJi52zj%r*~>KZ;Wp7G@3Ng&LNT}uSI(w$7=pwgv0Og`*np{N8`j2(%I6X_w7Em+%& zU&ES9opEIJs2&hDoRvPhVuw3K9ap-f8b*S>ZcsEN$%|b}xaY$}gS|X-6}n4#n0(mD zLQzR>2AM(RqU-E8@k&ODAdoyt;z7**Fq$Om7oABxDtl}Ykq*AjsRcPEoLsB|e0 zlMg#tC@RSnBD0rRxW2zAc-J8ooV;|6mEhyB$1D)zPhu$OSTGD;qv=YQRO6yDNnY$) zLQ(0G4-*Yhy`7}^u#-iAN-VL)^NH9IC&$;(aV1BH7O}<=EeR^|d)UW*Yat6bDk|Mk zjgQLYc(H4V0G00eh=FP8Nzv=4zM;XY~z!I9McduHKHuE+gUY1%u#-h#!C7<53=MH0*4yg)sF}wh21L$ZuxwyRO6yDNnY$)BCz1@WD*CJF6CkJVJ8bkCI34M793xP*dwS6)|C-O z=WQ*ZQr}WZMv>+M^Uf@CE?G@ZL_HcRT~dvU$|QNQYY9cAOFm3AMD=!(;=@iBib`^K znc3FWVpwpU1y>7><>nag`sMvs%!5-;+?}x|V^MN|qmCavfZNTN|#jQqB2Qd z>{>!m>5`8)s7#6vJ6R|yi8_KxT~VePzIfF-uH^mG;1f>uf0)2O$2VsbN`5f!fx*&8 zL#0cqaZ#BhFLo`VsC3Ck98@O7hn*}GmBb^Ni(N}7DqZps2bD?jVJ8bkrM`sozZlqOR8~EnItcEEupA%$wwSiCdG%HEP`<*^Nqoq2gqb& zMJ*9>P^s?$)W{ICwD>*X5}%xRy6_H5`c~Ar9af&Zq8b;KN%CUX62Z9AolN4O(xp61 zKI~+nsH_nDX_hZ5YMEWs+zWjJHCdNBx5G?0e!0HSh4>KJq0Cic=c7i3TvCmT$|QNQ zYY9cAOFm3AM2!q3#fP0N0#u?A$z{Xy)?79Hzb(*}j5P6p(2c?Wc0!bhw`+h?MwDb+ zM*aVG^j$V?sK!U7I|+n&v1^F{mG1b6hstF5u#-hFu7n5H-+(%ual|HrMY4g&p~Tx^ zv;k&`p7X!wah3kx6JR>3w}XatMKz2Bd)*L>=aS>at|i>_5eJnn+s5R>P8Nzv=Df!V zCW)7m&kGjOglfU@Yd|V_cc@o`um4(?P}25)pBhKbfBR~P%sn})FX*l*(K(NO7< zYFtz%$%|b}C@Nj@VWJ@_DwE>FP8K_Pp6I`3FYmQ`r+XREcdcHV9GmD3@&?Pd`DA)W z`qKZUZFhN?q5cE)^E~+%b=!_hwjj}eizA*F=U5-N+vcGiMUHjJFES{KL|4s|v(oa(wR!o@$#=7Sd){e@ z-TQQ*&@5bZ3t#Qte4kpYGipup99geJWWaL-&lCLinmC!`SGxIWg#4K~Ua+-L|r zFVoQ8+})MyYRwnTZO`>IWoPGmTH3pc8Z){4@$H>0U5g4w%*}M?+PgX@mXs6~^H(?` z-ILAtbY~`ZW_t47P1(W`GkfM|+nZ-(mNa%P$aGGeUtHE&(OTJBQqodU+*H;yWPp%b zxJ^<;(>n8+?$)N}OwI+>9eC0S+oqcC>dbd{WwV*?qFFtivora8duLm&rYYZqt{6FC zTCT1=o9R7X-JEYfJu_*+$tS0pnit54b?upK%OMlwN@P~uDo>E=Y0tKVPdR8pV^eoq zCOkT*sovpwnbCBIG^dvwa;(Qw&#}=)h^C7_v8f% z!86dTgH(a<@R>j>{vBzu9Zzq{_GC^z*&D?DgKaR4F^mt64jr&_P+|N1SH!=M#HwwJ z+d!g-cu7{;4jA&lqXmZ5*(?~#1$DDC*-Udjvjx=tqEH&x&qsi-RR+W9Fg_S>4c*CX uqakv{KS{o~XZs+{IBom4)rBR;T|DYHzZ?Bp=@oZw_|ZPwf2XhJmHz`W!VTvD From d6351940e6d491344a31278a17d4d9296277cef7 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 4 Jul 2024 23:32:46 +0300 Subject: [PATCH 20/35] lgd3d: more readable matrix operations --- libsrc/lgd3d/d6Base.cpp | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index 37dd386..5bbb9c0 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -2,15 +2,22 @@ #include +#define D3D_OVERLOADS #include #include #include -double z_near = 1.0, z_far = 200, inv_z_far = 0.005; -double z1 = 1.005025125628141, z2 = 1.005025125628141; +double z_near = 1.0; +double z_far = 200.0; +// near / far +double inv_z_far = 1 / 200; +// far / (far - near) +double z1 = 200.0 / (200.0 - 1.0); +// near * far / (far - near) +double z2 = 1.0 * 200.0 / (200.0 - 1.0); double z2d = 1.0, w2d = 1.0; -double zbias; +double zbias = 0.0; static DWORD dwErrorCode; static int hD3DError; @@ -486,29 +493,18 @@ const char* GetDDErrorMsg(long hRes) void set1(D3DMATRIX* m) { - m->_24 = 0.0; - m->_23 = 0.0; - m->_21 = 0.0; - m->_14 = 0.0; - m->_13 = 0.0; - m->_12 = 0.0; - m->_43 = 0.0; - m->_42 = 0.0; - m->_41 = 0.0; - m->_34 = 0.0; - m->_32 = 0.0; - m->_31 = 0.0; - m->_44 = 1.0; - m->_33 = 1.0; - m->_22 = 1.0; - m->_11 = 1.0; + *m = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }; } void setwbnf(IDirect3DDevice3* lpDev, double dvWNear, double dvWFar) { // WVP D3DMATRIX matWorld, matView, matProj; - float Q; set1(&matWorld); set1(&matView); @@ -517,12 +513,14 @@ void setwbnf(IDirect3DDevice3* lpDev, double dvWNear, double dvWFar) { lpDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); lpDev->SetTransform(D3DTRANSFORMSTATE_VIEW, &matView); - Q = dvWFar / (dvWFar - dvWNear); - matProj._33 = Q; - matProj._43 = -dvWNear * Q; - matProj._34 = 1.0; - matProj._44 = 0.0; + // Generate left-handed perspective projection + float Q = dvWFar / (dvWFar - dvWNear); + matProj(2, 2) = Q; + matProj(3, 2) = -dvWNear * Q; + matProj(2, 3) = 1.0; + matProj(3, 3) = 0.0; lpDev->SetTransform(D3DTRANSFORMSTATE_PROJECTION, &matProj); + } } From 48dd1c0c830f46986570af31ecedc330dba4eacd Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 5 Jul 2024 02:06:22 +0300 Subject: [PATCH 21/35] lgd3d update --- libsrc/dev2d/grs.h | 2 +- libsrc/lgd3d/d6Base.cpp | 63 +- libsrc/lgd3d/d6Frame.cpp | 37 +- libsrc/lgd3d/d6Frame.h | 27 + libsrc/lgd3d/d6Intfc.cpp | 1024 +++++++++++++++++++++++++++- libsrc/lgd3d/d6Prim_s.cpp | 2 + libsrc/lgd3d/d6States.h | 8 +- libsrc/lgd3d/d6sts_s.cpp | 39 +- libsrc/lgd3d/lgSurf.cpp | 63 +- libsrc/lgd3d/lgd3d.h | 53 +- libsrc/lgd3d/lgd3d.vcxproj | 2 + libsrc/lgd3d/lgd3d.vcxproj.filters | 3 + libsrc/lgd3d/lgd3d_g.cpp | 17 +- 13 files changed, 1164 insertions(+), 176 deletions(-) create mode 100644 libsrc/lgd3d/d6Frame.h diff --git a/libsrc/dev2d/grs.h b/libsrc/dev2d/grs.h index 8f07511..d4ef84f 100644 --- a/libsrc/dev2d/grs.h +++ b/libsrc/dev2d/grs.h @@ -49,7 +49,7 @@ typedef ulong grs_rgb; /* hey, it's an rgb bitmask */ typedef struct grs_rgb_bitmask { - ulong red, green, blue; + ulong red, green, blue, alpha; } grs_rgb_bitmask; /* structure for bitmaps to be drawn from and to. if a bitmap is contained diff --git a/libsrc/lgd3d/d6Base.cpp b/libsrc/lgd3d/d6Base.cpp index 5bbb9c0..cacf79a 100644 --- a/libsrc/lgd3d/d6Base.cpp +++ b/libsrc/lgd3d/d6Base.cpp @@ -1,23 +1,10 @@ -#include -#include - -#define D3D_OVERLOADS #include #include -#include +#include +#include -double z_near = 1.0; -double z_far = 200.0; -// near / far -double inv_z_far = 1 / 200; -// far / (far - near) -double z1 = 200.0 / (200.0 - 1.0); -// near * far / (far - near) -double z2 = 1.0 * 200.0 / (200.0 - 1.0); -double z2d = 1.0, w2d = 1.0; -double zbias = 0.0; static DWORD dwErrorCode; static int hD3DError; @@ -41,7 +28,7 @@ void SetLGD3DErrorCode(DWORD dwCode, DWORD hResult) const char* GetLgd3dErrorCode(DWORD dwErrorCode) { - assert(dwErrorCode != LGD3D_EC_OK); + Assert_(dwErrorCode != LGD3D_EC_OK); switch (dwErrorCode) { @@ -491,47 +478,3 @@ const char* GetDDErrorMsg(long hRes) } } -void set1(D3DMATRIX* m) -{ - *m = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f - }; -} - -void setwbnf(IDirect3DDevice3* lpDev, double dvWNear, double dvWFar) -{ - // WVP - D3DMATRIX matWorld, matView, matProj; - - set1(&matWorld); - set1(&matView); - set1(&matProj); - if (dvWFar > dvWNear) - { - lpDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); - lpDev->SetTransform(D3DTRANSFORMSTATE_VIEW, &matView); - // Generate left-handed perspective projection - float Q = dvWFar / (dvWFar - dvWNear); - matProj(2, 2) = Q; - matProj(3, 2) = -dvWNear * Q; - matProj(2, 3) = 1.0; - matProj(3, 3) = 0.0; - lpDev->SetTransform(D3DTRANSFORMSTATE_PROJECTION, &matProj); - - } -} - -void lgd3d_set_znearfar(double znear, double zfar) -{ - z_near = znear; - z_far = zfar; - inv_z_far = 1.0 / zfar; - z1 = zfar / (zfar - znear); - z2 = znear * z1; - z1 = z1 - zbias; - if (pcStates) - setwbnf(g_lpD3Ddevice, znear, zfar); -} diff --git a/libsrc/lgd3d/d6Frame.cpp b/libsrc/lgd3d/d6Frame.cpp index 0015c43..69e9137 100644 --- a/libsrc/lgd3d/d6Frame.cpp +++ b/libsrc/lgd3d/d6Frame.cpp @@ -1,7 +1,6 @@ +#include + #include -#include -#include -#include #include #include #include @@ -23,23 +22,21 @@ int g_bWFog; DWORD g_dwScreenWidth; DWORD g_dwScreenHeight; D3DMATERIALHANDLE g_hBackgroundMaterial; -DDPIXELFORMAT g_RGBTextureFormat; +extern DDPIXELFORMAT g_RGBTextureFormat; DDSURFACEDESC2 g_sDescOfRenderBuffer; D3DDEVICEDESC g_sD3DDevDesc; DDPIXELFORMAT g_sDDPFDepth; -DDPIXELFORMAT* g_FormatList[5]; +extern DDPIXELFORMAT* g_FormatList[5]; float g_XOffset; float g_YOffset; -int g_bUseDepthBuffer; -int g_bUseTableFog; -int g_bUseVertexFog; +extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; cD6Renderer* pcRenderer; IDirect3D3* g_lpD3D; IDirect3DViewport3* g_lpViewport; IDirect3DMaterial3* g_lpBackgroundMaterial; -int g_b8888supported; +extern BOOL g_b8888supported; HRESULT CALLBACK c_EnumZBufferFormats(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext); @@ -54,28 +51,6 @@ static inline void RaiseLGD3DErrorCode(DWORD dwCode, DWORD hResult) lgd3d_g_bInitialized = false; } -class cD6Frame -{ -public: - cD6Frame(ILGSurface* pILGSurface); - cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info* psDeviceInfo); - ~cD6Frame(); - -private: - void InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags); - void InitializeEnvironment(lgd3ds_device_info* psDeviceInfo); - HRESULT GetDDstuffFromDisplay(); - HRESULT CreateDepthBuffer(); - int CreateD3D(const GUID& sDeviceGUID); - void ExamineRenderingCapabilities(); - -private: - DWORD m_dwRequestedFlags; - bool m_bDepthBuffer; - DWORD m_dwTextureOpCaps; - IWinDisplayDevice* m_pWinDisplayDevice; -}; - cD6Frame::cD6Frame(ILGSurface* pILGSurface) { auto dwWidth = pILGSurface->GetWidth(); diff --git a/libsrc/lgd3d/d6Frame.h b/libsrc/lgd3d/d6Frame.h new file mode 100644 index 0000000..4c1e753 --- /dev/null +++ b/libsrc/lgd3d/d6Frame.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include + +class cD6Frame +{ +public: + cD6Frame(ILGSurface* pILGSurface); + cD6Frame(DWORD dwWidth, DWORD dwHeight, lgd3ds_device_info* psDeviceInfo); + ~cD6Frame(); + +private: + void InitializeGlobals(DWORD dwWidth, DWORD dwHeight, DWORD dwRequestedFlags); + void InitializeEnvironment(lgd3ds_device_info* psDeviceInfo); + HRESULT GetDDstuffFromDisplay(); + HRESULT CreateDepthBuffer(); + int CreateD3D(const GUID& sDeviceGUID); + void ExamineRenderingCapabilities(); + +private: + DWORD m_dwRequestedFlags; + bool m_bDepthBuffer; + DWORD m_dwTextureOpCaps; + IWinDisplayDevice* m_pWinDisplayDevice; +}; diff --git a/libsrc/lgd3d/d6Intfc.cpp b/libsrc/lgd3d/d6Intfc.cpp index d5262fb..2e14ad7 100644 --- a/libsrc/lgd3d/d6Intfc.cpp +++ b/libsrc/lgd3d/d6Intfc.cpp @@ -1,43 +1,997 @@ +#include +#include + +#define D3D_OVERLOADS +#include +#include + #include #include #include #include -#include + +#include #include +#include -#include -#include +#include +#include #include +#include + +BOOL lgd3d_g_bInitialized = FALSE; +BOOL g_bPrefer_RGB; +cD6Frame* pcFrame = nullptr; + +extern cD6Renderer* pcRenderer; +extern cD6Primitives* pcRenderBuffer; +extern DDPIXELFORMAT g_TransRGBTextureFormat, g_PalTextureFormat, g_AlphaTextureFormat, g_8888TexFormat, g_RGBTextureFormat; +extern float g_XOffset, g_YOffset; + +BOOL lgd3d_z_normal = TRUE; +double z_near = 1.0; +double z_far = 200.0; +// near / far +double inv_z_far = 1 / 200; +// far / (far - near) +double z1 = 200.0 / (200.0 - 1.0); +// near * far / (far - near) +double z2 = 1.0 * 200.0 / (200.0 - 1.0); +extern "C" { +double z2d = 1.0, w2d = 1.0; +} +double zbias = 0.0; + +double drZBiasStock[LGD3D_ZBIAS_STACK_DEPTH] = {}; +size_t dwZBiasStackPtr = 0; +long double drZBiasTable[] = +{ + 0.0, + 1 / 32786, + 1 / 16384, + 1 / 8192, + 1 / 4096, + 1 / 2048, + 1 / 1024, + 1 / 512, + 1 / 256, + 1 / 128, + 1 / 64, + 1 / 32, + 1 / 16, + 1 / 8, + 1 / 4, + 1 / 2, + 1.0 // unused +}; + +static void set1(D3DMATRIX* m) +{ + *m = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }; +} + +static void setwbnf(IDirect3DDevice3* lpDev, double dvWNear, double dvWFar) +{ + // WVP + D3DMATRIX matWorld, matView, matProj; + + set1(&matWorld); + set1(&matView); + set1(&matProj); + if (dvWFar > dvWNear) + { + lpDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld); + lpDev->SetTransform(D3DTRANSFORMSTATE_VIEW, &matView); + // Generate left-handed perspective projection + float Q = dvWFar / (dvWFar - dvWNear); + matProj(2, 2) = Q; + matProj(3, 2) = -dvWNear * Q; + matProj(2, 3) = 1.0; + matProj(3, 3) = 0.0; + lpDev->SetTransform(D3DTRANSFORMSTATE_PROJECTION, &matProj); + } +} + +void lgd3d_set_RGB() +{ + // empty +} + +void lgd3d_set_hardware() +{ + // empty +} + +void lgd3d_set_software() +{ + // empty +} + +void lgd3d_texture_set_RGB(BOOL is_RGB) +{ + g_bPrefer_RGB = is_RGB; +} + + +BOOL lgd3d_is_RGB() +{ + return TRUE; +} + +BOOL lgd3d_is_hardware() +{ + return TRUE; +} + + +BOOL lgd3d_init(lgd3ds_device_info* device_info) +{ + if (pcFrame) + { + Warning(("lgd3d_init():: library already initialized!\n")); + AssertMsg(lgd3d_g_bInitialized == TRUE, "Missuse of the variable\"lgd3d_g_bInitialized\"\n"); + return TRUE; + } + + lgd3d_g_bInitialized = TRUE; + pcFrame = new cD6Frame{ static_cast(grd_cap->w), static_cast(grd_cap->h), device_info }; + if (!lgd3d_g_bInitialized) + lgd3d_shutdown(); + + return lgd3d_g_bInitialized; +} + +BOOL lgd3d_attach_to_lgsurface(ILGSurface* pILGSurface) +{ + if (!pILGSurface) + { + Warning(("lgd3d_attach_to_lgsurface::called with NULL")); + return FALSE; + } + + if (lgd3d_g_bInitialized) + lgd3d_shutdown(); + + lgd3d_g_bInitialized = TRUE; + pcFrame = new cD6Frame{ pILGSurface }; + if (!lgd3d_g_bInitialized) + lgd3d_shutdown(); + + return lgd3d_g_bInitialized; +} + +void lgd3d_clean_render_surface(BOOL bDepthBuffToo) +{ + pcRenderer->CleanRenderSurface(bDepthBuffToo); +} + + +void lgd3d_shutdown() +{ + if (pcFrame) + delete pcFrame; + + pcFrame = nullptr; + lgd3d_g_bInitialized = FALSE; +} + + +void lgd3d_start_frame(int frame) +{ + if (!pcFrame) + return; + + pcRenderer->StartFrame(frame); +} + +void lgd3d_end_frame() +{ + if (!pcFrame) + return; + + pcRenderer->EndFrame(); +} + + +BOOL lgd3d_overlays_master_switch(BOOL bOverlaysOn) +{ + return pcRenderer->SwitchOverlaysOnOff(bOverlaysOn); +} + + +void lgd3d_blit() +{ + // empty +} + +void lgd3d_clear(int color_index) +{ + if (!pcFrame) + return; + + pcRenderBuffer->Clear(color_index); +} + + +void lgd3d_set_zwrite(int zwrite) +{ + if (!pcFrame) + return; + + pcStates->SetZWrite(zwrite); +} + +void lgd3d_set_zcompare(int zwrite) +{ + if (!pcFrame) + return; + + pcStates->SetZCompare(zwrite); +} + +void lgd3d_zclear() +{ + Warning(("zclear not yet implemented\n")); +} + +void lgd3d_set_znearfar(double znear, double zfar) +{ + z_near = znear; + z_far = zfar; + inv_z_far = 1.0 / zfar; + z1 = zfar / (zfar - znear); + z2 = znear * z1; + z1 = z1 - zbias; + + if (pcStates) + setwbnf(g_lpD3Ddevice, znear, zfar); +} + +void lgd3d_get_znearfar(double* pdZNear, double* pdZFar) +{ + if (pdZNear) + *pdZNear = z_near; + + if (pdZFar) + *pdZFar = z_far; +} + + +void lgd3d_clear_z_rect(int x0, int y0, int x1, int y1) +{ + if (!pcFrame) + return; + + pcRenderer->CleanDepthBuffer(x0, y0, x1, y1); +} + +void lgd3d_set_z(float z) +{ + if (lgd3d_z_normal) + { + z2d = z; + return; + } + + z2d = std::clamp(z1 - z2 / z, 0.0, 1.0); + w2d = 1.0 / z; +} + +int /* D3DZBUFFERTYPE? */ lgd3d_get_depth_buffer_state() +{ + if (!pcFrame) + return -1; + + return pcStates->GetDepthBufferState(); +} + +BOOL lgd3d_is_zwrite_on() +{ + if (!pcFrame) + return -1; + + return pcStates->IsZWriteOn(); +} + +BOOL lgd3d_is_zcompare_on() +{ + if (!pcFrame) + return -1; + + return pcStates->IsZCompareOn(); +} + + +double lgd3d_set_zbias(double new_bias) +{ + auto old_bias = zbias; + z1 = zbias - new_bias + z1; + zbias = new_bias; + return old_bias; +} + +void lgd3d_push_zbias_i(int nZBias) +{ + AssertMsg(dwZBiasStackPtr < LGD3D_ZBIAS_STACK_DEPTH - 1, "Z-Bias stack overflow!"); // FIXME: dwZBiasStackPtr < LGD3D_ZBIAS_STACK_DEPTH + drZBiasStock[dwZBiasStackPtr++] = zbias; + + AssertMsg1(nZBias <= 16, "Z-Bias value %i is out of the [0,16] range", nZBias); + lgd3d_set_zbias(drZBiasTable[nZBias]); +} + +void lgd3d_pop_zbias() +{ + AssertMsg(dwZBiasStackPtr > 0, "Z-Bias stack underflow!"); + lgd3d_set_zbias(drZBiasStock[dwZBiasStackPtr--]); +} + + +BOOL lgd3d_set_shading(BOOL bSmoothShading) +{ + if (!pcFrame) + return -1; + + return pcStates->SetSmoothShading(bSmoothShading); +} + +BOOL lgd3d_is_smooth_shading_on() +{ + if (!pcFrame) + return -1; + + return pcStates->IsSmoothShadingOn(); +} + + +BOOL lgd3d_is_alpha_blending_on() +{ + if (!pcFrame) + return -1; + + return pcStates->IsAlphaBlendingOn(); +} + + +void lgd3d_set_alpha(float alpha) +{ + if (!pcFrame) + return; + + pcStates->SetAlphaColor(alpha); +} + +void lgd3d_set_blend(BOOL do_blend) +{ + if (!pcFrame) + return; + + pcStates->EnableAlphaBlending(do_blend); +} + +void lgd3d_blend_normal() +{ + if (!pcFrame) + return; + + pcStates->ResetDefaultAlphaModulate(); +} + + +void lgd3d_blend_multiply(int blend_mode) +{ + if (!pcFrame) + return; + + pcStates->SetAlphaModulateHack(blend_mode); +} + + +void lgd3d_set_chromakey(int red, int green, int blue) +{ + if (!pcFrame) + return; + + pcStates->SetChromaKey(red, green, blue); +} + + +void lgd3d_set_dithering(BOOL bOn) +{ + if (!pcFrame) + return; + + pcStates->SetDithering(bOn); +} + +BOOL lgd3d_is_dithering_on() +{ + // FIXME: pcStates check? + return pcStates->GetDitheringState(); +} + + +void lgd3d_set_antialiasing(BOOL bOn) +{ + if (!pcFrame) + return; + + pcStates->SetAntialiasing(bOn); +} + +BOOL lgd3d_is_antialiasing_on() +{ + // FIXME: pcStates check? + return pcStates->GetAntialiasingState(); +} + + +BOOL lgd3d_enable_specular(BOOL bUseIt) +{ + // FIXME: pcStates check? + return pcStates->EnableSpecular(bUseIt); +} + + +void lgd3d_set_fog_level(float fog_level) +{ + if (!pcFrame) + return; + + pcStates->SetFogSpecularLevel(fog_level); +} + +void lgd3d_set_fog_color(int r, int g, int b) +{ + if (!pcFrame) + return; + + pcStates->SetFogColor(r, g, b); +} + +void lgd3d_set_fog_enable(BOOL enable) +{ + if (!pcFrame) + return; + + pcStates->EnableFog(enable); +} + +void lgd3d_set_fog_density(float density) +{ + if (!pcFrame) + return; + + pcStates->SetFogDensity(density); +} + +BOOL lgd3d_is_fog_on() +{ + if (!pcFrame) + return -1; + + return pcStates->IsFogOn(); +} + +int lgd3d_use_linear_table_fog(BOOL bUseIt) +{ + // FIXME: pcStates check? + return pcStates->UseLinearTableFog(bUseIt); +} + +void lgd3d_set_fog_start_end(float fStart, float fEnd) +{ + if (!pcFrame) + return; + + pcStates->SetFogStartAndEnd(fStart, fEnd); +} + +void lgd3d_set_linear_fog_distance(float fDistance) +{ + if (!pcFrame) + return; + + pcStates->SetLinearFogDistance(fDistance); +} + + +void lgd3d_set_texture_level(int n) +{ + if (!pcFrame) + return; + + pcStates->SetTextureLevel(n); +} + +void lgd3d_get_texblending_modes(ulong* pulLevel0Mode, ulong* pulLevel1Mode) +{ + if (!pcFrame) + return; + + pcStates->GetTexBlendingModes(pulLevel0Mode, pulLevel1Mode); +} + + +void lgd3d_hack_light(r3s_point* p, float r) +{ + if (!pcFrame) + return; + + pcRenderBuffer->HackLight(p, r); +} + +void lgd3d_hack_light_extra(r3s_point* p, float r, grs_bitmap* bm) +{ + if (!pcFrame) + return; + + pcRenderBuffer->HackLightExtra(p, r, bm); +} + + +BOOL lgd3d_get_texture_wrapping(DWORD dwLevel) +{ + if (!pcFrame) + return -1; + + return pcStates->GetTexWrapping(dwLevel); +} + +BOOL lgd3d_set_texture_wrapping(DWORD dwLevel, BOOL bSetSmooth) +{ + if (!pcFrame) + return -1; + + return pcStates->SetTexWrapping(dwLevel, bSetSmooth); +} + + +void lgd3d_set_pal(uint start, uint n, uchar* pal) +{ + lgd3d_set_pal_slot(start, n, pal, 0); +} + +void lgd3d_set_pal_slot(uint start, uint n, uchar* pal, int slot) +{ + lgd3d_set_pal_slot_flags(start, n, pal, slot, 3); +} + +void lgd3d_set_pal_slot_flags(uint start, uint n, uchar* pal, int slot, int flags) +{ + if (!pcFrame) + return; + + pcStates->SetPalSlotFlags(start, n, pal, slot, flags); +} + + +void lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask* bitmask) +{ + if (!g_TransRGBTextureFormat.dwFlags) + { + g_TransRGBTextureFormat.dwBBitMask = 0; + g_TransRGBTextureFormat.dwGBitMask = 0; + g_TransRGBTextureFormat.dwRBitMask = 0; + g_TransRGBTextureFormat.dwRGBAlphaBitMask = 0; + } + + bitmask->alpha = g_TransRGBTextureFormat.dwRGBAlphaBitMask; + bitmask->red = g_TransRGBTextureFormat.dwRBitMask; + bitmask->green = g_TransRGBTextureFormat.dwGBitMask; + bitmask->blue = g_TransRGBTextureFormat.dwBBitMask; +} + +void lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask* bitmask) +{ + if (!g_RGBTextureFormat.dwFlags) + { + g_RGBTextureFormat.dwBBitMask = 0; + g_RGBTextureFormat.dwGBitMask = 0; + g_RGBTextureFormat.dwRBitMask = 0; + g_RGBTextureFormat.dwRGBAlphaBitMask = 0; + } + + bitmask->alpha = g_RGBTextureFormat.dwRGBAlphaBitMask; + bitmask->red = g_RGBTextureFormat.dwRBitMask; + bitmask->green = g_RGBTextureFormat.dwGBitMask; + bitmask->blue = g_RGBTextureFormat.dwBBitMask; +} + +void lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask* bitmask) +{ + if (!g_AlphaTextureFormat.dwFlags) + { + g_AlphaTextureFormat.dwBBitMask = 0; + g_AlphaTextureFormat.dwGBitMask = 0; + g_AlphaTextureFormat.dwRBitMask = 0; + g_AlphaTextureFormat.dwRGBAlphaBitMask = 0; + } + + bitmask->alpha = g_AlphaTextureFormat.dwRGBAlphaBitMask; + bitmask->red = g_AlphaTextureFormat.dwRBitMask; + bitmask->green = g_AlphaTextureFormat.dwGBitMask; + bitmask->blue = g_AlphaTextureFormat.dwBBitMask; +} + + +void lgd3d_set_texture_clut(uchar* clut) +{ + texture_clut = clut; + if (!g_tmgr) + return; + + g_tmgr->set_clut(clut); +} + +uchar* lgd3d_set_clut(uchar* clut) +{ + auto* old_clut = std::exchange(lgd3d_clut, clut); + lgd3d_set_texture_clut(clut); + + return old_clut; +} + + +void lgd3d_disable_palette() +{ + if (!pcFrame) + return; + + pcStates->EnablePalette(FALSE); +} + +void lgd3d_enable_palette() +{ + if (!pcFrame) + return; + + pcStates->EnablePalette(TRUE); +} + + +void lgd3d_set_alpha_pal(ushort* pal) +{ + if (!pcFrame) + return; + + pcStates->SetAlphaPalette(pal); +} + + +void lgd3d_set_offsets(int x, int y) +{ + g_XOffset = x; + g_YOffset = y; +} + +void lgd3d_get_offsets(int* x, int* y) +{ + if (x) + *x = g_XOffset; + + if (y) + *y = g_YOffset; +} + + +int lgd3d_draw_point(r3s_point* p) +{ + return pcRenderBuffer->DrawPoint(p); +} + +void lgd3d_draw_line(r3s_point* p0, r3s_point* p1) +{ + if (!pcFrame) + return; + + pcRenderBuffer->DrawLine(p0, p1); +} + + +BOOL lgd3d_set_poly_mode(ePolyMode eNewMode) +{ + if (!pcFrame) + return FALSE; + + return pcRenderBuffer->SetPolyMode(eNewMode); +} + +ePolyMode lgd3d_get_poly_mode() +{ + if (!pcFrame) + return ePolyMode::kLgd3dILLEGALPolyMode; + + return pcRenderBuffer->GetPolyMode(); +} + + +int lgd3d_g2upoly(int n, g2s_point** vpl) +{ + return pcRenderBuffer->g2UPoly(n, vpl); +} + +int lgd3d_g2poly(int n, g2s_point** vpl) +{ + return pcRenderBuffer->g2Poly(n, vpl); +} + +int lgd3d_g2utrifan(int n, g2s_point** vpl) +{ + return pcRenderBuffer->g2UTrifan(n, vpl); +} + +int lgd3d_g2trifan(int n, g2s_point** vpl) +{ + return pcRenderBuffer->g2Trifan(n, vpl); +} + + +tLgd3dDrawPolyFunc lgd3d_draw_poly_func = nullptr; +tLgd3dDrawPolyIndexedFunc lgd3d_draw_poly_indexed_func = nullptr; + +void lgd3d_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_indexed_trifan; + +} + +void lgd3d_lit_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_lit_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_lit_indexed_trifan; +} + +void lgd3d_rgblit_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_rgblit_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_rgblit_indexed_trifan; +} + +void lgd3d_rgbalit_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_rgbalit_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_rgbalit_indexed_trifan; +} + +void lgd3d_rgbafoglit_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_rgbafoglit_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_rgbafoglit_indexed_trifan; +} + +void lgd3d_diffspecular_tmap_setup(grs_bitmap* bm) +{ + if (!pcFrame) + return; + + lgd3d_set_texture(bm); + lgd3d_draw_poly_func = lgd3d_diffspecular_trifan; + lgd3d_draw_poly_indexed_func = lgd3d_diffspecular_indexed_trifan; +} + +void lgd3d_poly_setup() +{ + if (!pcFrame) + return; + + pcStates->set_texture_id(-1); + lgd3d_draw_poly_func = lgd3d_poly; + lgd3d_draw_poly_indexed_func = lgd3d_indexed_poly; +} + +void lgd3d_spoly_setup() +{ + if (!pcFrame) + return; + + pcStates->set_texture_id(-1); + lgd3d_draw_poly_func = lgd3d_spoly; + lgd3d_draw_poly_indexed_func = lgd3d_indexed_spoly; +} + +void lgd3d_rgb_poly_setup() +{ + if (!pcFrame) + return; + + pcStates->set_texture_id(-1); + lgd3d_draw_poly_func = lgd3d_rgb_poly; + lgd3d_draw_poly_indexed_func = lgd3d_rgb_indexed_poly; +} + +void lgd3d_rgba_poly_setup() +{ + if (!pcFrame) + return; + + pcStates->set_texture_id(-1); + lgd3d_draw_poly_func = lgd3d_rgba_poly; + lgd3d_draw_poly_indexed_func = lgd3d_rgba_indexed_poly; +} + + +int lgd3d_poly(int n, r3s_point** vpl) +{ + return pcRenderBuffer->Poly(n, vpl); +} + +int lgd3d_indexed_poly(int n, r3s_point** vpl, r3ixs_info* info) +{ + return pcRenderBuffer->PolyInd(n, vpl, info); +} + +int lgd3d_spoly(int n, r3s_point** vpl) +{ + return pcRenderBuffer->SPoly(n, vpl); +} + +int lgd3d_indexed_spoly(int n, r3s_point** vpl, r3ixs_info* info) +{ + return pcRenderBuffer->SPolyInd(n, vpl, info); +} + +int lgd3d_rgb_poly(int n, r3s_point** ppl) +{ + return pcRenderBuffer->RGB_Poly(n, ppl); +} + +int lgd3d_rgb_indexed_poly(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->RGB_PolyInd(n, ppl, info); +} + +int lgd3d_rgba_poly(int n, r3s_point** ppl) +{ + return pcRenderBuffer->RGBA_Poly(n, ppl); +} + +int lgd3d_rgba_indexed_poly(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->RGBA_PolyInd(n, ppl, info); +} + +int lgd3d_trifan(int n, r3s_point** vpl) +{ + return pcRenderBuffer->Trifan(n, vpl); +} + +int lgd3d_indexed_trifan(int n, r3s_point** vpl, r3ixs_info* info) +{ + return pcRenderBuffer->TrifanInd(n, vpl, info); +} + +int lgd3d_lit_trifan(int n, r3s_point** vpl) +{ + return pcRenderBuffer->LitTrifan(n, vpl); +} + +int lgd3d_lit_indexed_trifan(int n, r3s_point** vpl, r3ixs_info* info) +{ + return pcRenderBuffer->LitTrifanInd(n, vpl, info); +} + +int lgd3d_rgblit_trifan(int n, r3s_point** ppl) +{ + return pcRenderBuffer->RGBlitTrifan(n, ppl); +} + +int lgd3d_rgblit_indexed_trifan(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->RGBlitTrifanInd(n, ppl, info); +} + +int lgd3d_rgbalit_trifan(int n, r3s_point** ppl) +{ + return pcRenderBuffer->RGBAlitTrifan(n, ppl); +} + +int lgd3d_rgbalit_indexed_trifan(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->RGBAlitTrifanInd(n, ppl, info); +} + +int lgd3d_rgbafoglit_trifan(int n, r3s_point** ppl) +{ + return pcRenderBuffer->RGBAFogLitTrifan(n, ppl); +} + + +int lgd3d_rgbafoglit_indexed_trifan(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->RGBAFogLitTrifanInd(n, ppl, info); +} + +int lgd3d_diffspecular_trifan(int n, r3s_point** ppl) +{ + return pcRenderBuffer->DiffuseSpecularLitTrifan(n, ppl); +} + + +int lgd3d_diffspecular_indexed_trifan(int n, r3s_point** ppl, r3ixs_info* info) +{ + return pcRenderBuffer->DiffuseSpecularLitTrifanInd(n, ppl, info); +} + + +void lgd3d_release_indexed_primitives() +{ + pcRenderBuffer->EndIndexedRun(); +} + + +void lgd3d_set_texture_map_method(ulong flag) +{ + pcStates->SetTextureMapMode(flag); +} + +void lgd3d_set_light_map_method(ulong flag) +{ + pcStates->SetLightMapMode(flag); +} + + +int lgd3d_TrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->TrifanMTD(n, ppl, pptc); +} + +int lgd3d_LitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->LitTrifanMTD(n, ppl, pptc); +} + +int lgd3d_RGBlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->RGBlitTrifanMTD(n, ppl, pptc); +} + +int lgd3d_RGBAlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->RGBAlitTrifanMTD(n, ppl, pptc); +} + +int lgd3d_RGBAFoglitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->RGBAFogLitTrifanMTD(n, ppl, pptc); +} + +int lgd3d_DiffuseSpecularMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) +{ + return pcRenderBuffer->DiffuseSpecularLitTrifanMTD(n, ppl, pptc); +} + +int lgd3d_g2UTrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** vptc) +{ + return pcRenderBuffer->g2UTrifanMTD(n, vpl, vptc); +} -BOOL lgd3d_g_bInitialized = false; - - -int lgd3d_rgb_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); -int lgd3d_rgba_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); -//int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); -//int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); -int lgd3d_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); -//int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); -//void lgd3d_tmap_setup(grs_bitmap *bm); -//void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); -int lgd3d_rgblit_trifan(int n, r3s_point **ppl); -int lgd3d_rgblit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -//void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); -int lgd3d_rgbalit_trifan(int n, r3s_point **ppl); -int lgd3d_rgbalit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -//void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); -int lgd3d_rgbafoglit_trifan(int n, r3s_point **ppl); -int lgd3d_rgbafoglit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); -//void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); -int lgd3d_diffspecular_trifan(int n, r3s_point **ppl); -int lgd3d_diffspecular_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); - -//void lgd3d_lit_tmap_setup(grs_bitmap *bm); -//void lgd3d_poly_setup(); -//void lgd3d_spoly_setup(); -//void lgd3d_rgb_poly_setup(); -int lgd3d_rgb_poly(int n, r3s_point **ppl); -//void lgd3d_rgba_poly_setup(); -int lgd3d_rgba_poly(int n, r3s_point **ppl); - -void setwbnf(IDirect3DDevice3 *lpDev, long double dvWNear, long double dvWFar); +int lgd3d_g2TrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** vptc) +{ + return pcRenderBuffer->g2TrifanMTD(n, vpl, vptc); +} diff --git a/libsrc/lgd3d/d6Prim_s.cpp b/libsrc/lgd3d/d6Prim_s.cpp index d6c24fc..f9cdb5f 100644 --- a/libsrc/lgd3d/d6Prim_s.cpp +++ b/libsrc/lgd3d/d6Prim_s.cpp @@ -1,5 +1,7 @@ #include +cD6Primitives* pcRenderBuffer = nullptr; + struct MTVERTEX { float sx, sy, sz, rhw; diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index 8066dae..e511d9d 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -222,11 +222,7 @@ extern IDirectDraw4* g_lpDD_ext; extern BOOL g_bUseDepthBuffer, g_bUseTableFog, g_bUseVertexFog; extern BOOL g_bTexSuspended; -extern int bSpewOn; -extern char* GetDDErrorMsg(int hRes); -extern int g_bPrefer_RGB; - -extern void SetLGD3DErrorCode(ulong dwCode, long hRes); -extern const char* GetLgd3dErrorCode(ulong dwErrorCode); +extern BOOL bSpewOn; +extern BOOL g_bPrefer_RGB; extern BOOL lgd3d_g_bInitialized; diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 8ff1193..de24670 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -27,15 +27,15 @@ #endif // #include "d3dmacs.h" -#include "tmgr.h" // for g_tmgr #include -#include "d6States.h" -#include -#include - #include #include #include +#include + +#include +#include +#include #ifndef SHIP @@ -49,6 +49,7 @@ AssertMsg3(hRes==0, pcDXef, msg, hRes, GetDDErrorMsg(hRes)) extern cD6Primitives* pcRenderBuffer; extern cD6Renderer* pcRenderer; +cD6States *pcStates = nullptr; class cImStates : public cD6States { @@ -161,8 +162,9 @@ sTexBlendArgs sMultiTexBlendArgsProtos[3][2] = int b_SS2_UseSageTexManager; ushort** texture_pal_list[4] = { texture_pal_opaque, texture_pal_opaque, /* is it working? */ &alpha_pal, texture_pal_trans}; +extern "C" BOOL lgd3d_blend_trans; BOOL lgd3d_blend_trans = TRUE; -static D3DBLEND table[4] = { D3DBLEND_ZERO, D3DBLEND_ONE, D3DBLEND_SRCCOLOR, D3DBLEND_DESTCOLOR }; +static D3DBLEND table[] = { D3DBLEND_ZERO, D3DBLEND_ONE, D3DBLEND_SRCCOLOR, D3DBLEND_DESTCOLOR }; void GetAvailableTexMem(ulong* local, ulong* agp); @@ -181,7 +183,7 @@ void blit_16to16(tdrv_texture_info *info, uint16 *dst, int drow); void blit_16to16_scale(tdrv_texture_info *info, uint16 *dst, int drow); void blit_32to32(tdrv_texture_info *info, uint16 *dst, int drow); void blit_32to32_scale(tdrv_texture_info *info, uint16 *dst, int drow); -void blit_32to16(tdrv_texture_info *info, uint16 *dst, unsigned int drow); +void blit_32to16(tdrv_texture_info *info, uint16 *dst, int drow); int STDMETHODCALLTYPE EnumTextureFormatsCallback(DDPIXELFORMAT* lpDDPixFmt, void* lpContext); void CheckSurfaces(sWinDispDevCallbackInfo *info); void InitDefaultTexture(int size); @@ -410,7 +412,7 @@ void cD6States::InitTextureManager() if (g_tmgr) { g_tmgr->shutdown(); - g_tmgr = 0; + g_tmgr = nullptr; } g_tmgr = get_dopey_texture_manager(pcStates); @@ -1865,28 +1867,25 @@ cImStates::cImStates() cImStates::~cImStates() { - sTextureData* psTD; - IWinDisplayDevice* pWinDisplayDevice; - int i; - if (m_bTextureListInitialized) { - if (g_tmgr != NULL) + if (g_tmgr != nullptr) { g_tmgr->shutdown(); - g_tmgr = 0; + g_tmgr = nullptr; } - pWinDisplayDevice = AppGetObj(IWinDisplayDevice); + + auto* pWinDisplayDevice = AppGetObj(IWinDisplayDevice); pWinDisplayDevice->RemoveTaskSwitchCallback(callback_id); - if (pWinDisplayDevice) - pWinDisplayDevice->Release(); + SafeRelease(pWinDisplayDevice); - for (i = 0; i < LGD3D_MAX_TEXTURES; i++) + for (int i = 0; i < LGD3D_MAX_TEXTURES; i++) { - psTD = &g_saTextures[i]; + auto* psTD = &g_saTextures[i]; SafeRelease(psTD->lpTexture); SafeRelease(psTD->lpSurface); } + m_bTextureListInitialized = FALSE; } @@ -1896,7 +1895,7 @@ cImStates::~cImStates() default_bm = NULL; } - for (i = 0; i < MAX_PALETTES; i++) + for (int i = 0; i < MAX_PALETTES; i++) { if (texture_pal_opaque[i]) { diff --git a/libsrc/lgd3d/lgSurf.cpp b/libsrc/lgd3d/lgSurf.cpp index 1c23e5d..1b2693f 100644 --- a/libsrc/lgd3d/lgSurf.cpp +++ b/libsrc/lgd3d/lgSurf.cpp @@ -1,12 +1,67 @@ +#define INITGUID #include -class cLGSurface : public ILGSurface, public ILGDD4Surface +#include + +class cLGSurface final : public ILGSurface, public ILGDD4Surface { +public: + DECLARE_UNAGGREGATABLE(); + +public: + cLGSurface(); + ~cLGSurface(); + + void ReleaseContent(); + void RecordSurfaceDescription(DDSURFACEDESC2* lpDDSD); + void FixThePitchInCanvas(); + void SetBitsInCanvas(void* pvData); + +public: + virtual HRESULT STDMETHODCALLTYPE CreateInternalScreenSurface(HWND hMainWindow) override; + virtual long STDMETHODCALLTYPE ChangeClipper(HWND hMainWindow) override; + virtual HRESULT STDMETHODCALLTYPE SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; + virtual HRESULT STDMETHODCALLTYPE Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; + + virtual HRESULT STDMETHODCALLTYPE BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) override; + + virtual void STDMETHODCALLTYPE CleanSurface() override; + virtual void STDMETHODCALLTYPE Start3D() override; + virtual void STDMETHODCALLTYPE End3D() override; + virtual HRESULT STDMETHODCALLTYPE LockFor2D(grs_canvas** ppsCanvas, eLGSBlit eBlitFlags) override; + virtual HRESULT STDMETHODCALLTYPE UnlockFor2D() override; + + virtual DWORD STDMETHODCALLTYPE GetWidth() override; + virtual DWORD STDMETHODCALLTYPE GetHeight() override; + virtual DWORD STDMETHODCALLTYPE GetPitch() override; + virtual DWORD STDMETHODCALLTYPE GetBitDepth() override; + virtual eLGSurfState STDMETHODCALLTYPE GetSurfaceState() override; + + virtual HRESULT STDMETHODCALLTYPE GetSurfaceDescription(sLGSurfaceDescription* psDsc) override; + + virtual int STDMETHODCALLTYPE GetDeviceInfoIndex() override; + virtual int STDMETHODCALLTYPE GetDirectDraw(IDirectDraw4** ppDD) override; + virtual int STDMETHODCALLTYPE GetRenderSurface(IDirectDrawSurface4** ppRS) override; + +private: + int m_nFrameCount; + IDirectDraw4* m_lpDD4; + IDirectDrawSurface4* m_lpScreen; + IDirectDrawSurface4* m_lpTheSurface; + int m_nD3DDevID; + eLGSurfState m_eSurfState; + BOOL m_bZbuffer; + BOOL m_b3DAttached; + sLGSurfaceDescription m_sDescription; + grs_canvas m_sCanvas; }; -BOOL CreateLGSurface(ILGSurface **ppILGSurf) +IMPLEMENT_UNAGGREGATABLE2_SELF_DELETE(cLGSurface, ILGSurface, ILGDD4Surface); + + +BOOL CreateLGSurface(ILGSurface** ppILGSurf) { - *ppILGSurf = new cLGSurface(); - return *ppILGSurf != nullptr; + *ppILGSurf = new cLGSurface(); + return *ppILGSurf != nullptr; } \ No newline at end of file diff --git a/libsrc/lgd3d/lgd3d.h b/libsrc/lgd3d/lgd3d.h index 312f8ae..08bcb80 100644 --- a/libsrc/lgd3d/lgd3d.h +++ b/libsrc/lgd3d/lgd3d.h @@ -113,7 +113,7 @@ extern int lgd3d_enumerate_devices_capable_of( ulong flags ); extern void lgd3d_set_RGB(void); extern void lgd3d_set_hardware(void); extern void lgd3d_set_software(void); -extern void lgd3d_texture_set_RGB(bool is_RGB); +extern void lgd3d_texture_set_RGB(BOOL is_RGB); // state query functions (won't change between init and shutdown) extern BOOL lgd3d_is_RGB(void); @@ -192,7 +192,7 @@ extern void lgd3d_set_blend(BOOL do_blend); extern void lgd3d_blend_normal(void); extern void lgd3d_blend_multiply(int blend_mode); //from below -enum { +typedef enum { BLEND_DEST_ZERO=0, BLEND_SRC_ZERO=0, BLEND_SRC_ONE=1, @@ -201,7 +201,7 @@ enum { BLEND_DEST_ONE=4, BLEND_DEST_SRC=8, BLEND_DEST_DEST=12 -}; +} eBlendMode; //efects: @@ -313,10 +313,6 @@ extern BOOL lgd3d_set_poly_mode( ePolyMode eNewMode ); extern ePolyMode lgd3d_get_poly_mode(); -extern int lgd3d_trifan(int n, r3s_point **vpl); -extern int lgd3d_lit_trifan(int n, r3s_point **vpl); -extern int lgd3d_poly(int n, r3s_point **vpl); -extern int lgd3d_spoly(int n, r3s_point **vpl); extern int lgd3d_g2upoly(int n, g2s_point **vpl); extern int lgd3d_g2poly(int n, g2s_point **vpl); extern int lgd3d_g2utrifan(int n, g2s_point **vpl); @@ -334,10 +330,10 @@ extern void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); extern void lgd3d_rgbalit_tmap_setup(grs_bitmap *bm); extern void lgd3d_rgbafoglit_tmap_setup(grs_bitmap *bm); // rgba + fog extern void lgd3d_diffspecular_tmap_setup(grs_bitmap *bm); // rgba + fog -extern void lgd3d_poly_setup(grs_bitmap *bm); -extern void lgd3d_spoly_setup(grs_bitmap *bm); -extern void lgd3d_rgb_poly_setup(grs_bitmap *bm); -extern void lgd3d_rgba_poly_setup(grs_bitmap *bm); +extern void lgd3d_poly_setup(); +extern void lgd3d_spoly_setup(); +extern void lgd3d_rgb_poly_setup(); +extern void lgd3d_rgba_poly_setup(); // indexed primitives: @@ -350,12 +346,38 @@ typedef void (*fp_release_IP)( void ); extern fp_release_IP lgd3d_release_ip_func; + +extern int lgd3d_poly(int n, r3s_point **vpl); extern int lgd3d_indexed_poly(int n, r3s_point **vpl, r3ixs_info *info); + +extern int lgd3d_spoly(int n, r3s_point **vpl); extern int lgd3d_indexed_spoly(int n, r3s_point **vpl, r3ixs_info *info); -extern void lgd3d_rgblit_tmap_setup(grs_bitmap *bm); + +extern int lgd3d_rgb_poly(int n, r3s_point **ppl); +extern int lgd3d_rgb_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); + +extern int lgd3d_rgba_poly(int n, r3s_point **ppl); +extern int lgd3d_rgba_indexed_poly(int n, r3s_point **ppl, r3ixs_info *info); + +extern int lgd3d_trifan(int n, r3s_point **vpl); +extern int lgd3d_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); + +extern int lgd3d_lit_trifan(int n, r3s_point **vpl); extern int lgd3d_lit_indexed_trifan(int n, r3s_point **vpl, r3ixs_info *info); -extern int lgd3d_release_indexed_primitives( void ); +extern int lgd3d_rgblit_trifan(int n, r3s_point **ppl); +extern int lgd3d_rgblit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); + +extern int lgd3d_rgbalit_trifan(int n, r3s_point **ppl); +extern int lgd3d_rgbalit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); + +extern int lgd3d_rgbafoglit_trifan(int n, r3s_point **ppl); +extern int lgd3d_rgbafoglit_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); + +extern int lgd3d_diffspecular_trifan(int n, r3s_point **ppl); +extern int lgd3d_diffspecular_indexed_trifan(int n, r3s_point **ppl, r3ixs_info *info); + +extern void lgd3d_release_indexed_primitives( void ); @@ -428,7 +450,10 @@ extern int lgd3d_g2TrifanMTD( int n, g2s_point **vpl, LGD3D_tex_coord **vptc ); -BOOL lgd3d_get_error( DWORD* pdwCode, DWORD* phResult ); +BOOL lgd3d_get_error( DWORD* pdwCode, DWORD* phResult ); +const char* GetDDErrorMsg(long hRes); +void SetLGD3DErrorCode(DWORD dwCode, DWORD hResult); +const char* GetLgd3dErrorCode(DWORD dwErrorCode); extern uchar* texture_clut, *lgd3d_clut; extern BOOL lgd3d_punt_d3d; diff --git a/libsrc/lgd3d/lgd3d.vcxproj b/libsrc/lgd3d/lgd3d.vcxproj index 902fcfd..e5c9fb7 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj +++ b/libsrc/lgd3d/lgd3d.vcxproj @@ -32,6 +32,7 @@ + @@ -113,6 +114,7 @@ true types.h true + stdcpp17 diff --git a/libsrc/lgd3d/lgd3d.vcxproj.filters b/libsrc/lgd3d/lgd3d.vcxproj.filters index 2834cc1..f66bbe2 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj.filters +++ b/libsrc/lgd3d/lgd3d.vcxproj.filters @@ -39,6 +39,9 @@ Header Files + + Header Files + diff --git a/libsrc/lgd3d/lgd3d_g.cpp b/libsrc/lgd3d/lgd3d_g.cpp index 08d6d62..09cbec3 100644 --- a/libsrc/lgd3d/lgd3d_g.cpp +++ b/libsrc/lgd3d/lgd3d_g.cpp @@ -1,9 +1,16 @@ #include -uchar lgd3d_punt_buffer; -BOOL lgd3d_punt_d3d; +extern "C" { + uchar lgd3d_punt_buffer; + BOOL lgd3d_punt_d3d; -uchar* texture_clut; -uchar* lgd3d_clut; + uchar* texture_clut; + uchar* lgd3d_clut; -void lgd3d_set_zlinear(int lin); \ No newline at end of file + BOOL zlinear; + + void lgd3d_set_zlinear(BOOL lin) + { + zlinear = lin; + } +} \ No newline at end of file From fd361ecf229fbf07f06509dbdffc6fbddf81307c Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 5 Jul 2024 12:16:30 +0300 Subject: [PATCH 22/35] Update d6sts_s.cpp getting rid of magic values --- libsrc/lgd3d/d6sts_s.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index de24670..20b7b03 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -144,14 +144,14 @@ cMSStates* cMSStates::m_Instance = NULL; int alpha_size_table[81], generic_size_table[81], rgb_size_table[81], trgb_size_table[81], b8888_size_table[81]; -sTexBlendArgs sTexBlendArgsProtos[3][2] = +sTexBlendArgs sTexBlendArgsProtos[LGD3DTB_NO_STATES][2] = { { { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, { { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, { { D3DTOP_BLENDDIFFUSEALPHA, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } } }; -sTexBlendArgs sMultiTexBlendArgsProtos[3][2] = +sTexBlendArgs sMultiTexBlendArgsProtos[LGD3DTB_NO_STATES][2] = { { { D3DTOP_SELECTARG1, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_DISABLE, D3DTA_TEXTURE, D3DTA_DIFFUSE } }, { { D3DTOP_SELECTARG1, D3DTA_TEXTURE, D3DTA_DIFFUSE, D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_DIFFUSE }, { D3DTOP_SELECTARG2, D3DTA_TEXTURE, D3DTA_CURRENT, D3DTOP_MODULATE, D3DTA_TEXTURE, D3DTA_CURRENT } }, @@ -161,10 +161,10 @@ sTexBlendArgs sMultiTexBlendArgsProtos[3][2] = // TODO: initialize in ScrnInit3d int b_SS2_UseSageTexManager; -ushort** texture_pal_list[4] = { texture_pal_opaque, texture_pal_opaque, /* is it working? */ &alpha_pal, texture_pal_trans}; +ushort** texture_pal_list[PF_MAX] = { texture_pal_opaque, texture_pal_opaque, /* is it working? */ &alpha_pal, texture_pal_trans}; extern "C" BOOL lgd3d_blend_trans; BOOL lgd3d_blend_trans = TRUE; -static D3DBLEND table[] = { D3DBLEND_ZERO, D3DBLEND_ONE, D3DBLEND_SRCCOLOR, D3DBLEND_DESTCOLOR }; +static D3DBLEND table[PF_MAX] = { D3DBLEND_ZERO, D3DBLEND_ONE, D3DBLEND_SRCCOLOR, D3DBLEND_DESTCOLOR }; void GetAvailableTexMem(ulong* local, ulong* agp); @@ -536,7 +536,7 @@ void cD6States::SetCommonDefaultStates(ulong dwRequestedFlags, int bMultiTexture } m_bCanModulate = g_lpD3Ddevice->ValidateDevice(&dwPasses) == S_OK; - memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[1], sizeof(m_psCurrentRS->saTexBlend)); + memcpy(m_psCurrentRS->saTexBlend, [1], sizeof(m_psCurrentRS->saTexBlend)); SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); From 0a460e26b362a0d0d7cd1e8003a9dd0eac46dfe0 Mon Sep 17 00:00:00 2001 From: barspinoff Date: Fri, 5 Jul 2024 12:17:33 +0300 Subject: [PATCH 23/35] Update d6sts_s.cpp --- libsrc/lgd3d/d6sts_s.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index 20b7b03..f6af657 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -536,7 +536,7 @@ void cD6States::SetCommonDefaultStates(ulong dwRequestedFlags, int bMultiTexture } m_bCanModulate = g_lpD3Ddevice->ValidateDevice(&dwPasses) == S_OK; - memcpy(m_psCurrentRS->saTexBlend, [1], sizeof(m_psCurrentRS->saTexBlend)); + memcpy(m_psCurrentRS->saTexBlend, sTexBlendArgsProtos[1], sizeof(m_psCurrentRS->saTexBlend)); SetTextureStageStateForGlobal(g_lpD3Ddevice, 0, D3DTSS_TEXCOORDINDEX, 0); SetTextureStageColors(g_lpD3Ddevice, 0, m_psCurrentRS); From a7797ea4359bef489cca84ebeb5cd5f482ae8f58 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 6 Jul 2024 16:50:24 +0300 Subject: [PATCH 24/35] lgd3d: lgsurf --- libsrc/lgd3d/lgSurf.cpp | 497 +++++++++++++++++++++++++++++++++++++++- libsrc/lgd3d/lgSurf_i.h | 4 +- 2 files changed, 490 insertions(+), 11 deletions(-) diff --git a/libsrc/lgd3d/lgSurf.cpp b/libsrc/lgd3d/lgSurf.cpp index 1b2693f..8ac5dc9 100644 --- a/libsrc/lgd3d/lgSurf.cpp +++ b/libsrc/lgd3d/lgSurf.cpp @@ -1,7 +1,25 @@ -#define INITGUID +#include #include -#include +#include +#include +#include +#include +#include +#include +#include + +extern BOOL lgd3d_g_bInitialized; + +#define MAKE_LGSHRESULT( code ) MAKE_HRESULT( 1, 0x404, code ) + +#define LGSERR_NOTINITIALIZED MAKE_LGSHRESULT( 1 ) +#define LGSERR_D3DNOTINITIALIZED MAKE_LGSHRESULT( 2 ) +#define LGSERR_DDNOTINITIALIZED MAKE_LGSHRESULT( 4 ) +#define LGSERR_GENERIC MAKE_LGSHRESULT( 5 ) +#define LGSERR_SURFACELOCKED MAKE_LGSHRESULT( 7 ) +#define LGSERR_SURFACEUNLOCKED MAKE_LGSHRESULT( 8 ) +#define LGSERR_INVALIDDESC MAKE_LGSHRESULT( 9 ) class cLGSurface final : public ILGSurface, public ILGDD4Surface { @@ -19,11 +37,11 @@ class cLGSurface final : public ILGSurface, public ILGDD4Surface public: virtual HRESULT STDMETHODCALLTYPE CreateInternalScreenSurface(HWND hMainWindow) override; - virtual long STDMETHODCALLTYPE ChangeClipper(HWND hMainWindow) override; - virtual HRESULT STDMETHODCALLTYPE SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; - virtual HRESULT STDMETHODCALLTYPE Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD pdwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; + virtual HRESULT STDMETHODCALLTYPE ChangeClipper(HWND hMainWindow) override; + virtual HRESULT STDMETHODCALLTYPE SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; + virtual HRESULT STDMETHODCALLTYPE Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) override; - virtual HRESULT STDMETHODCALLTYPE BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) override; + virtual HRESULT STDMETHODCALLTYPE BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) override; virtual void STDMETHODCALLTYPE CleanSurface() override; virtual void STDMETHODCALLTYPE Start3D() override; @@ -41,8 +59,8 @@ class cLGSurface final : public ILGSurface, public ILGDD4Surface virtual HRESULT STDMETHODCALLTYPE GetSurfaceDescription(sLGSurfaceDescription* psDsc) override; virtual int STDMETHODCALLTYPE GetDeviceInfoIndex() override; - virtual int STDMETHODCALLTYPE GetDirectDraw(IDirectDraw4** ppDD) override; - virtual int STDMETHODCALLTYPE GetRenderSurface(IDirectDrawSurface4** ppRS) override; + virtual BOOL STDMETHODCALLTYPE GetDirectDraw(IDirectDraw4** ppDD) override; + virtual BOOL STDMETHODCALLTYPE GetRenderSurface(IDirectDrawSurface4** ppRS) override; private: int m_nFrameCount; @@ -57,11 +75,472 @@ class cLGSurface final : public ILGSurface, public ILGDD4Surface grs_canvas m_sCanvas; }; +static inline void WarnSufraceError(const char* what, DWORD hResult) +{ + Warning(("%s: error %d\n%s ", what, hResult, GetDDErrorMsg(hResult))); +} + +static inline void RaiseSufraceError(const char* what, DWORD hResult) +{ + CriticalMsg3("%s: error %d\n%s ", what, hResult, GetDDErrorMsg(hResult)); +} + IMPLEMENT_UNAGGREGATABLE2_SELF_DELETE(cLGSurface, ILGSurface, ILGDD4Surface); +cLGSurface::cLGSurface() + : m_nFrameCount{ 0 }, m_lpDD4{ nullptr }, m_lpScreen{ nullptr }, m_lpTheSurface{ nullptr }, m_nD3DDevID{ -1 }, + m_eSurfState{ kLGSSUninitialized }, m_bZbuffer{ FALSE }, m_b3DAttached{ FALSE }, m_sDescription{}, m_sCanvas{} +{ +} + +cLGSurface::~cLGSurface() +{ + ReleaseContent(); +} + +void cLGSurface::ReleaseContent() +{ + if (m_b3DAttached) + lgd3d_shutdown(); + + SafeRelease(m_lpTheSurface); + SafeRelease(m_lpScreen); + SafeRelease(m_lpDD4); + + m_sDescription = {}; + m_sCanvas = {}; +} + +void cLGSurface::RecordSurfaceDescription(DDSURFACEDESC2* lpDDSD) +{ + m_sDescription = {}; + + m_sDescription.dwWidth = lpDDSD->dwWidth; + m_sDescription.dwHeight = lpDDSD->dwHeight; + m_sDescription.dwPitch = lpDDSD->dwLinearSize; + m_sDescription.dwBitDepth = lpDDSD->ddpfPixelFormat.dwRGBBitCount; + m_sDescription.sBitmask.red = lpDDSD->ddpfPixelFormat.dwRBitMask; + m_sDescription.sBitmask.green = lpDDSD->ddpfPixelFormat.dwGBitMask; + m_sDescription.sBitmask.blue = lpDDSD->ddpfPixelFormat.dwBBitMask; + m_sDescription.sBitmask.alpha = lpDDSD->ddpfPixelFormat.dwRGBAlphaBitMask; +} + +void cLGSurface::FixThePitchInCanvas() +{ + m_sCanvas.bm.row = m_sDescription.dwPitch; +} + +void cLGSurface::SetBitsInCanvas(void* pvData) +{ + m_sCanvas.bm.bits = static_cast(pvData); +} + +HRESULT STDMETHODCALLTYPE cLGSurface::CreateInternalScreenSurface(HWND hMainWindow) +{ + if (m_eSurfState != eLGSurfState::kLGSSUninitialized) + return LGSERR_NOTINITIALIZED; + + if (!LoadDirectDraw()) + return LGSERR_GENERIC; + + IDirectDraw* lpDD = nullptr; + auto hResult = DynDirectDrawCreate(nullptr, &lpDD, nullptr); + if (hResult) + { + RaiseSufraceError("DirectDrawCreation", hResult); + return LGSERR_GENERIC; + } + + hResult = lpDD->QueryInterface(IID_IDirectDraw4, reinterpret_cast(&m_lpDD4)); + if (hResult) + { + RaiseSufraceError("QueryInterface for DD4", hResult); + + SafeRelease(lpDD); + return LGSERR_GENERIC; + } + + hResult = m_lpDD4->SetCooperativeLevel(nullptr, DDSCL_NORMAL); + if (hResult) + { + RaiseSufraceError("SetCooperativeLevel for DD4", hResult); + + SafeRelease(lpDD); + SafeRelease(m_lpDD4); + return LGSERR_GENERIC; + } + + DDSURFACEDESC2 sDDSurfDesc = {}; + sDDSurfDesc.dwSize = sizeof(sDDSurfDesc); + sDDSurfDesc.dwFlags = DDSD_CAPS; + sDDSurfDesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + + hResult = m_lpDD4->CreateSurface(&sDDSurfDesc, &m_lpScreen, nullptr); + if (hResult) + { + RaiseSufraceError("CreateSurface: screen", hResult); + + SafeRelease(lpDD); + SafeRelease(m_lpDD4); + return LGSERR_GENERIC; + } + + ChangeClipper(hMainWindow); + SafeRelease(lpDD); + m_eSurfState = eLGSurfState::kLGSSInitialized; + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::ChangeClipper(HWND hMainWindow) +{ + IDirectDrawClipper* pIClipper = nullptr; + auto hResult = m_lpScreen->GetClipper(&pIClipper); + if (pIClipper) + { + HWND hClipWindow = nullptr; + pIClipper->GetHWnd(&hClipWindow); + if (hClipWindow != nullptr && hClipWindow == hMainWindow) + return S_OK; + + m_lpScreen->SetClipper(nullptr); + SafeRelease(pIClipper); + } + + if (!hMainWindow) + return S_OK; + + hResult = m_lpDD4->CreateClipper(0, &pIClipper, nullptr); + if (hResult) + { + RaiseSufraceError("CreateClipper", hResult); + SafeRelease(pIClipper); + + return LGSERR_GENERIC; + } + + hResult = pIClipper->SetHWnd(0, hMainWindow); + if (hResult) + { + RaiseSufraceError("SetHWnd(clipper)", hResult); + SafeRelease(pIClipper); + + return LGSERR_GENERIC; + } + + hResult = m_lpScreen->SetClipper(pIClipper); + if (hResult) + { + RaiseSufraceError("SetClipper", hResult); + SafeRelease(pIClipper); + + return LGSERR_GENERIC; + } + + SafeRelease(pIClipper); + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::SetAs3dHdwTarget(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) +{ + if (lgd3d_g_bInitialized) + return LGSERR_D3DNOTINITIALIZED; + + *pdwCapabilityFlags = 0; + GUID* pCurGuid = nullptr; + + if (m_eSurfState == eLGSurfState::kLGSSUninitialized) + { + auto* pIWinDispDevice = AppGetObj(IWinDisplayDevice); + pIWinDispDevice->GetDirectDraw(&m_lpDD4); + if (!m_lpDD4) + return LGSERR_DDNOTINITIALIZED; + + auto bReturn = pIWinDispDevice->GetBitmapSurface(nullptr, &m_lpScreen); + SafeRelease(pIWinDispDevice); + + if (!bReturn) + { + ReleaseContent(); + return LGSERR_DDNOTINITIALIZED; + } + + if (!m_lpScreen) + CriticalMsg("No render surface available."); + + auto* pIDisplayDevice = AppGetObj(IDisplayDevice); + pIDisplayDevice->GetKind2(nullptr, nullptr, &pCurGuid); + SafeRelease(pIDisplayDevice); + } + + m_nD3DDevID = -1; + auto nNoDevices = lgd3d_enumerate_devices(); + for (int i = 0; i < nNoDevices; ++i) + { + auto* pDevGuid = lgd3d_get_device_info(i)->p_ddraw_guid; + + if (pCurGuid && pDevGuid && IsEqualGUID(*pCurGuid, *pDevGuid)) + { + m_nD3DDevID = i; + break; + } + + if (pCurGuid == nullptr && pDevGuid == nullptr) + { + m_nD3DDevID = i; + break; + } + } + + if (m_nD3DDevID == -1) + return LGSERR_DDNOTINITIALIZED; + + auto* pD3DInfo = lgd3d_get_device_info(m_nD3DDevID); + pD3DInfo->flags |= dwRequestedFlags; + + DDSURFACEDESC2 sSurfaceDesc = {}; + sSurfaceDesc.dwSize = sizeof(sSurfaceDesc); + sSurfaceDesc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + sSurfaceDesc.ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE | DDSCAPS_OFFSCREENPLAIN; + sSurfaceDesc.dwWidth = dwWidth; + sSurfaceDesc.dwHeight = dwHeight; + + auto hResult = m_lpDD4->CreateSurface(&sSurfaceDesc, &m_lpTheSurface, nullptr); + if (hResult) + { + cLGSurface::ReleaseContent(); + WarnSufraceError("cLGSurface::CreateSurface", hResult); + + return hResult == DDERR_OUTOFVIDEOMEMORY ? 0x80040406 : LGSERR_GENERIC; + } + + sSurfaceDesc = {}; + sSurfaceDesc.dwSize = sizeof(sSurfaceDesc); + + hResult = m_lpTheSurface->GetSurfaceDesc(&sSurfaceDesc); + if (hResult) + { + RaiseSufraceError("cLGSurface::GetSurfaceDesc", hResult); + return LGSERR_GENERIC; + } + + RecordSurfaceDescription(&sSurfaceDesc); + if (!lgd3d_attach_to_lgsurface(this)) + { + ReleaseContent(); + return LGSERR_GENERIC; + } + + m_b3DAttached = TRUE; + *pdwCapabilityFlags = pD3DInfo->flags; + m_bZbuffer = *pdwCapabilityFlags & (LGD3DF_ZBUFFER | LGD3DF_WBUFFER); + gr_init_canvas(&m_sCanvas, nullptr, BMT_FLAT16, dwWidth, dwHeight); + + FixThePitchInCanvas(); + SetBitsInCanvas(nullptr); + *ppsCanvas = &m_sCanvas; + m_eSurfState = eLGSurfState::kLGSSUnlocked; + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::Resize3dHdw(DWORD dwRequestedFlags, DWORD dwWidth, DWORD dwHeight, DWORD dwBitDepth, DWORD* pdwCapabilityFlags, grs_canvas** ppsCanvas) +{ + ReleaseContent(); + + return SetAs3dHdwTarget(dwRequestedFlags, dwWidth, dwHeight, dwBitDepth, pdwCapabilityFlags, ppsCanvas); +} + +HRESULT STDMETHODCALLTYPE cLGSurface::BlitToScreen(DWORD dwXScreen, DWORD dwYScreen, DWORD dwWidth, DWORD dwHeight) +{ + if (!m_b3DAttached) + CriticalMsg("cLGSurface::BlitToScreen 3dhardware not attached"); + + if (m_eSurfState != eLGSurfState::kLGSSUnlocked) + return LGSERR_SURFACELOCKED; + + if (dwHeight > m_sDescription.dwHeight || dwWidth > m_sDescription.dwWidth) + return LGSERR_INVALIDDESC; + + RECT sRect = {}; + sRect.left = 0; + sRect.top = 0; + sRect.right = dwWidth; + sRect.bottom = dwHeight; + + RECT dRect = {}; + dRect.left = dwXScreen; + dRect.top = dwYScreen; + dRect.right = dwWidth + dwXScreen; + dRect.bottom = dwHeight + dwYScreen; + + auto* pIDisplayDevice = AppGetObj(IDisplayDevice); + auto nLockCount = pIDisplayDevice->BreakLock(); + + auto hResult = m_lpScreen->Blt(&dRect, m_lpTheSurface, &sRect, DDBLT_WAIT, nullptr); + if (hResult) + { + WarnSufraceError("cLGSurface::BlitToScreen", hResult); + return LGSERR_GENERIC; + } + + pIDisplayDevice->RestoreLock(nLockCount); + SafeRelease(pIDisplayDevice); + + return S_OK; +} + +void STDMETHODCALLTYPE cLGSurface::CleanSurface() +{ + if (!m_b3DAttached) + CriticalMsg("cLGSurface::CleanSurface 3dhardware not attached"); + + if (m_eSurfState != eLGSurfState::kLGSSUnlocked) + CriticalMsg("cLGSurface::CleanSurface surface was locked!"); + + lgd3d_clean_render_surface(m_bZbuffer); +} + +void STDMETHODCALLTYPE cLGSurface::Start3D() +{ + if (!m_b3DAttached) + CriticalMsg("cLGSurface::Start3D 3dhardware not attached"); + + if (m_eSurfState != eLGSurfState::kLGSSUnlocked) + CriticalMsg("cLGSurface::Start3D surface was locked!"); + + lgd3d_start_frame(m_nFrameCount++); + + m_eSurfState = eLGSurfState::kLGSS3DRenderining; +} + +void STDMETHODCALLTYPE cLGSurface::End3D() +{ + if (!m_b3DAttached) + CriticalMsg("cLGSurface::End3D 3dhardware not attached"); + + if (m_eSurfState != kLGSS3DRenderining) + CriticalMsg("cLGSurface::End3D surface was not in 3d state!"); + + lgd3d_end_frame(); + + m_eSurfState = eLGSurfState::kLGSSUnlocked; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::LockFor2D(grs_canvas** ppsCanvas, eLGSBlit eBlitFlags) +{ + if (m_eSurfState != eLGSurfState::kLGSSUnlocked) + return LGSERR_SURFACELOCKED; + + DWORD dwFlags = DDLOCK_NOSYSLOCK | DDLOCK_WAIT; + if (eBlitFlags & eLGSBlit::kLGSBRead) + dwFlags |= DDLOCK_READONLY; + else if (eBlitFlags & eLGSBlit::kLGSBWrite) + dwFlags |= DDLOCK_WRITEONLY; + + DDSURFACEDESC2 sDDSD = {}; + sDDSD.dwSize = sizeof(sDDSD); + + auto hResult = m_lpTheSurface->Lock(nullptr, &sDDSD, dwFlags, nullptr); + if (hResult) + { + WarnSufraceError("cLGSurface::LockFor2D", hResult); + return LGSERR_GENERIC; + } + + m_eSurfState = eLGSurfState::kLGSS2DLocked; + RecordSurfaceDescription(&sDDSD); + FixThePitchInCanvas(); + SetBitsInCanvas(sDDSD.lpSurface); + + *ppsCanvas = &m_sCanvas; + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::UnlockFor2D() +{ + if (m_eSurfState != eLGSurfState::kLGSS2DLocked) + return LGSERR_SURFACEUNLOCKED; + + auto hResult = m_lpTheSurface->Unlock(nullptr); + if (hResult) + { + WarnSufraceError("cLGSurface::UnlockFor2D", hResult); + return hResult == DDERR_NOTLOCKED ? LGSERR_SURFACEUNLOCKED : LGSERR_GENERIC; + } + + m_eSurfState = eLGSurfState::kLGSSUnlocked; + SetBitsInCanvas(nullptr); + + return S_OK; +} + +DWORD STDMETHODCALLTYPE cLGSurface::GetWidth() +{ + return m_sDescription.dwWidth; +} + +DWORD STDMETHODCALLTYPE cLGSurface::GetHeight() +{ + return m_sDescription.dwHeight; +} + +DWORD STDMETHODCALLTYPE cLGSurface::GetPitch() +{ + return m_sDescription.dwPitch; +} + +DWORD STDMETHODCALLTYPE cLGSurface::GetBitDepth() +{ + return m_sDescription.dwBitDepth; +} + +eLGSurfState STDMETHODCALLTYPE cLGSurface::GetSurfaceState() +{ + return m_eSurfState; +} + +HRESULT STDMETHODCALLTYPE cLGSurface::GetSurfaceDescription(sLGSurfaceDescription* psDsc) +{ + if (!psDsc) + return LGSERR_INVALIDDESC; + + *psDsc = m_sDescription; + + return S_OK; +} + +int STDMETHODCALLTYPE cLGSurface::GetDeviceInfoIndex() +{ + return m_nD3DDevID; +} + +int STDMETHODCALLTYPE cLGSurface::GetDirectDraw(IDirectDraw4** ppDD) +{ + *ppDD = m_lpDD4; + if (!m_lpDD4) + return FALSE; + + m_lpDD4->AddRef(); + + return TRUE; +} + +BOOL STDMETHODCALLTYPE cLGSurface::GetRenderSurface(IDirectDrawSurface4** ppRS) +{ + *ppRS = m_lpScreen; + if (!m_lpScreen) + return FALSE; + + m_lpScreen->AddRef(); + + return TRUE; +} BOOL CreateLGSurface(ILGSurface** ppILGSurf) { - *ppILGSurf = new cLGSurface(); + *ppILGSurf = new cLGSurface{}; return *ppILGSurf != nullptr; } \ No newline at end of file diff --git a/libsrc/lgd3d/lgSurf_i.h b/libsrc/lgd3d/lgSurf_i.h index 8652528..031eb36 100644 --- a/libsrc/lgd3d/lgSurf_i.h +++ b/libsrc/lgd3d/lgSurf_i.h @@ -272,12 +272,12 @@ DECLARE_INTERFACE_(ILGDD4Surface, IUnknown) STDMETHOD_( int, GetDeviceInfoIndex ) (THIS); - STDMETHOD_( int, GetDirectDraw ) ( + STDMETHOD_( BOOL, GetDirectDraw ) ( THIS_ /*[out]*/ IDirectDraw4 **ppDD ); - STDMETHOD_( int, GetRenderSurface ) ( + STDMETHOD_( BOOL, GetRenderSurface ) ( THIS_ /*[out]*/ IDirectDrawSurface4 **ppRS ); From cbd5af54cd2ebda30d3fba0aaca4b75eded589e8 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 6 Jul 2024 16:55:14 +0300 Subject: [PATCH 25/35] lgd3d: cMSStates update --- libsrc/lgd3d/d6sts_s.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index f6af657..b99b37b 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -2568,7 +2568,11 @@ void cMSStates::SetLightMapMode(DWORD dwFlag) m_psCurrentRS->dwTexBlendMode[1] = dwFlag; else Warning(("cMSStates::SetLightMapMode(): mode %i out of range.\n", dwFlag)); +} +void cMSStates::SetTextureLevel(int n) +{ + m_dwCurrentTexLevel = n; } void calc_size(tdrv_texture_info* info, d3d_cookie cookie) From b00f59055508bf4940cad415cce0b5f036829761 Mon Sep 17 00:00:00 2001 From: Kirill Yurkin <47507219+ugozapad@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:19:44 +0300 Subject: [PATCH 26/35] Partial implementation of cD6Renderer --- libsrc/lgd3d/d6Over.cpp | 50 +------- libsrc/lgd3d/d6Over.h | 57 ++++++++- libsrc/lgd3d/d6Prim.h | 64 +++++++++- libsrc/lgd3d/d6Prim_s.cpp | 58 --------- libsrc/lgd3d/d6Render.cpp | 246 +++++++++++++++++++++++++++++++++++++- libsrc/lgd3d/d6Render.h | 4 +- libsrc/lgd3d/d6States.h | 44 +++++++ libsrc/lgd3d/d6sts_s.cpp | 48 +------- 8 files changed, 408 insertions(+), 163 deletions(-) diff --git a/libsrc/lgd3d/d6Over.cpp b/libsrc/lgd3d/d6Over.cpp index 85c2d1c..25be6ea 100644 --- a/libsrc/lgd3d/d6Over.cpp +++ b/libsrc/lgd3d/d6Over.cpp @@ -4,32 +4,7 @@ #include #include -struct sOverRectangle -{ - float fX0, fU0, fY0, fV0; - float fX1, fU1, fY1, fV1; -}; - -struct sLGD3DOverlayInfo -{ - DWORD dwFlags; - grs_bitmap *pBitmap; - float fX0, fY0; - float fX1, fY1; - float tu0, tv0; - float tu1, tv1; - int nAlpha, nRed, nGreen, nBlue; -}; - -struct sBaseOverData -{ - float fX0, fY0; - float fX1, fY1; - float fU0, fV0; - float fU1, fV1; - DWORD dwColor; - bool bReady; -}; +cD6OverlayHandler* pcOverlayHandler = nullptr; class cD6AlphaOverlay : public cD6OvelayType { @@ -66,29 +41,6 @@ class cD6AlphaOverlay : public cD6OvelayType D3DTLVERTEX m_saVertices[4]; }; -class cD6OverlayHandler -{ -public: - cD6OverlayHandler(const cD6OverlayHandler &); - cD6OverlayHandler(); - ~cD6OverlayHandler(); - - void AddOverlay(cD6OvelayType *pcNewOver, unsigned long *phOver); - void InsertOverlayAfter(cD6OvelayType *pcNewOver, cD6OvelayType *pcAfterOver, unsigned long *phOver); - void RemoveOverlay(cD6OvelayType *pcOver); - void RemoveAllOverlays(); - void KillBranch(cD6OvelayType *pcOver); - void SetClipViewport(sOverRectangle *psInRect); - void GetClipViewport(sOverRectangle *psInRect); - void DrawOverlays(); - int OverlayFromHandle(unsigned long hOver, cD6OvelayType **ppcAlphaOver); - int AlphaOverlayFromHandle(unsigned long hOver, cD6AlphaOverlay **ppcAlphaOver); - unsigned long MakeNewOverlayHandle(cD6OvelayType *pcOver); - -private: - cD6OvelayType m_cListHead; -}; - int lgd3d_aol_add(sLGD3DOverlayInfo *psOverInfo, unsigned int *phOver); int lgd3d_aol_insert(sLGD3DOverlayInfo *psOverInfo, unsigned int hAfterMe, unsigned int *phOver); int lgd3d_aol_remove(unsigned int hOver); diff --git a/libsrc/lgd3d/d6Over.h b/libsrc/lgd3d/d6Over.h index 356f283..8a1d42f 100644 --- a/libsrc/lgd3d/d6Over.h +++ b/libsrc/lgd3d/d6Over.h @@ -1,6 +1,36 @@ #pragma once +#include + +struct sOverRectangle +{ + float fX0, fU0, fY0, fV0; + float fX1, fU1, fY1, fV1; +}; + +struct sLGD3DOverlayInfo +{ + DWORD dwFlags; + grs_bitmap* pBitmap; + float fX0, fY0; + float fX1, fY1; + float tu0, tv0; + float tu1, tv1; + int nAlpha, nRed, nGreen, nBlue; +}; + +struct sBaseOverData +{ + float fX0, fY0; + float fX1, fY1; + float fU0, fV0; + float fU1, fV1; + DWORD dwColor; + bool bReady; +}; + class cD6OverlayHandler; +class cD6AlphaOverlay; class cD6OvelayType { cD6OvelayType(const class cD6OvelayType &); @@ -16,4 +46,29 @@ class cD6OvelayType { cD6OvelayType * m_pcPrevious; int m_bVisible; int m_bTurnedOff; -}; \ No newline at end of file +}; + +class cD6OverlayHandler +{ +public: + cD6OverlayHandler(const cD6OverlayHandler&); + cD6OverlayHandler(); + ~cD6OverlayHandler(); + + void AddOverlay(cD6OvelayType* pcNewOver, unsigned long* phOver); + void InsertOverlayAfter(cD6OvelayType* pcNewOver, cD6OvelayType* pcAfterOver, unsigned long* phOver); + void RemoveOverlay(cD6OvelayType* pcOver); + void RemoveAllOverlays(); + void KillBranch(cD6OvelayType* pcOver); + void SetClipViewport(sOverRectangle* psInRect); + void GetClipViewport(sOverRectangle* psInRect); + void DrawOverlays(); + int OverlayFromHandle(unsigned long hOver, cD6OvelayType** ppcAlphaOver); + int AlphaOverlayFromHandle(unsigned long hOver, cD6AlphaOverlay** ppcAlphaOver); + unsigned long MakeNewOverlayHandle(cD6OvelayType* pcOver); + +private: + cD6OvelayType m_cListHead; +}; + +extern cD6OverlayHandler* pcOverlayHandler; diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h index ff91c92..98b652f 100644 --- a/libsrc/lgd3d/d6Prim.h +++ b/libsrc/lgd3d/d6Prim.h @@ -6,6 +6,13 @@ #include #include +struct MTVERTEX +{ + float sx, sy, sz, rhw; + unsigned int color, specular; + float tu, tv, tu2, tv2; +}; + class cD6Primitives { protected: cD6Primitives(const class cD6Primitives &); @@ -58,7 +65,7 @@ class cD6Primitives { virtual int DrawPoint(r3s_point *p); D3DTLVERTEX * ReservePolySlots(int n); - virtual void DrawPoly(bool bSuspendTexturing); + virtual void DrawPoly(BOOL bSuspendTexturing); virtual int Poly(int n, r3s_point * * ppl); virtual int SPoly(int n, r3s_point * * ppl); virtual int RGB_Poly(int n, r3s_point * * ppl); @@ -124,3 +131,58 @@ class cD6Primitives { void HackLight(r3s_point *p, float r); void HackLightExtra(r3s_point *p, float r, grs_bitmap *bm); }; + +extern cD6Primitives* pcRenderBuffer; + +class cImBuffer : public cD6Primitives +{ +private: + static cImBuffer* m_Instance; + + cImBuffer(const class cImBuffer&); + cImBuffer(); + ~cImBuffer(); + +public: + static cD6Primitives* Instance(); + virtual cD6Primitives* DeInstance() override; +}; + +class cMSBuffer : public cD6Primitives +{ +private: + static cMSBuffer* m_Instance; + + cMSBuffer(const class cMSBuffer&); + cMSBuffer(); + ~cMSBuffer(); + +public: + static cD6Primitives* Instance(); + virtual cD6Primitives* DeInstance() override; + +private: + MTVERTEX m_saMTVertices[0x32]; + DWORD m_dwNoMTVertices; + DWORD m_dwMaxNoMTVertices; + +private: + virtual void DrawPoly(BOOL bSuspendTexturing) override; + virtual void FlushIndPolies() override; + virtual void DrawIndPolies() override; + + MTVERTEX* ReserveMTPolySlots(int n); + void DrawMTPoly(); + +public: + virtual int TrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int LitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int RGBlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int RGBAlitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int RGBAFogLitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int DiffuseSpecularLitTrifanMTD(int n, r3s_point** ppl, LGD3D_tex_coord** pptc) override; + virtual int g2UTrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** pptc) override; + virtual int g2TrifanMTD(int n, g2s_point** vpl, LGD3D_tex_coord** pptc) override; +}; + + diff --git a/libsrc/lgd3d/d6Prim_s.cpp b/libsrc/lgd3d/d6Prim_s.cpp index f9cdb5f..bbb2e1f 100644 --- a/libsrc/lgd3d/d6Prim_s.cpp +++ b/libsrc/lgd3d/d6Prim_s.cpp @@ -1,61 +1,3 @@ #include cD6Primitives* pcRenderBuffer = nullptr; - -struct MTVERTEX -{ - float sx, sy, sz, rhw; - unsigned int color, specular; - float tu, tv, tu2, tv2; -}; - -class cImBuffer : public cD6Primitives -{ -private: - static cImBuffer *m_Instance; - - cImBuffer(const class cImBuffer &); - cImBuffer(); - ~cImBuffer(); - -public: - cD6Primitives *Instance(); - virtual cD6Primitives *DeInstance() override; -}; - -class cMSBuffer : public cD6Primitives -{ -private: - static cMSBuffer *m_Instance; - - cMSBuffer(const class cMSBuffer &); - cMSBuffer(); - ~cMSBuffer(); - -public: - cD6Primitives *Instance(); - virtual cD6Primitives *DeInstance() override; - -private: - MTVERTEX m_saMTVertices[0x32]; - DWORD m_dwNoMTVertices; - DWORD m_dwMaxNoMTVertices; - -private: - virtual void DrawPoly(bool bSuspendTexturing) override; - virtual void FlushIndPolies() override; - virtual void DrawIndPolies() override; - - MTVERTEX *ReserveMTPolySlots(int n); - void DrawMTPoly(); - -public: - virtual int TrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int LitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int RGBlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int RGBAlitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int RGBAFogLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int DiffuseSpecularLitTrifanMTD(int n, r3s_point **ppl, LGD3D_tex_coord **pptc) override; - virtual int g2UTrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc) override; - virtual int g2TrifanMTD(int n, g2s_point **vpl, LGD3D_tex_coord **pptc) override; -}; \ No newline at end of file diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp index 1e6def1..4276f7d 100644 --- a/libsrc/lgd3d/d6Render.cpp +++ b/libsrc/lgd3d/d6Render.cpp @@ -1,53 +1,287 @@ +#include +#include #include "d6Render.h" +#include "d6States.h" +#include "d6Prim.h" +#include "d6Over.h" + +extern cD6Renderer* pcRenderer; +extern IDirect3DViewport3* g_lpViewport; +extern DWORD g_dwScreenWidth; +extern DWORD g_dwScreenHeight; +extern float g_XOffset; +extern float g_YOffset; + +#define _BYTE uint8 +#define BYTEn(x, n) (*((_BYTE*)&(x)+n)) +#define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0) cD6Renderer::cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) { + m_bOverlaysOn = TRUE; + + if (dwInitialBufferType) + { + if (dwInitialBufferType == 1) + { + pcRenderBuffer = cMSBuffer::Instance(); + pcStates = cMSStates::Instance(); + } + } + else + { + pcRenderBuffer = cImBuffer::Instance(); + pcStates = cImStates::Instance(); + } + + DWORD RenderStatesSize = pcStates->GetRenderStatesSize(); + CreateStatesStack(10, RenderStatesSize); + if (!pcStates->Initialize(*pdwRequestedFlags)) + { + if (dwInitialBufferType != 1) + { + lgd3d_g_bInitialized = 0; + DbgReportWarning("Could not Initialize D3D states\n"); + } + + pcStates->DeInstance(); + pcRenderBuffer->DeInstance(); + + DeleteStatesStack(); + + // bit flag? + DWORD v4 = *pdwRequestedFlags; + BYTE1(v4) = BYTE1(*pdwRequestedFlags) & 0xFE; + *pdwRequestedFlags = v4; + + pcRenderBuffer = cImBuffer::Instance(); + pcStates = cImStates::Instance(); + + DWORD v5 = pcStates->GetRenderStatesSize(); + CreateStatesStack(10, v5); + + if (pcStates->Initialize(*pdwRequestedFlags)) + { + DbgReportWarning("Can not use multitextures. Reverting to single texture mode.\n"); + } + else + { + lgd3d_g_bInitialized = 0; + DbgReportWarning("Could not Initialize D3D states\n"); + } + } } cD6Renderer::~cD6Renderer() { + pcStates->DeInstance(); + pcRenderBuffer->DeInstance(); + + DeleteStatesStack(); + + if (pcOverlayHandler) + { + delete pcOverlayHandler; + pcOverlayHandler = nullptr; + } } cD6Renderer* cD6Renderer::Instance(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) { - return nullptr; + if (!m_RendererInstance) + { + m_RendererInstance = new cD6Renderer(dwInitialBufferType, pdwRequestedFlags); + } + + return m_RendererInstance; } cD6Renderer* cD6Renderer::DeInstance() { - return nullptr; + if (m_RendererInstance) + { + delete m_RendererInstance; + m_RendererInstance = nullptr; + } + + return m_RendererInstance; } void cD6Renderer::CreateStatesStack(DWORD dwInitialSize, DWORD dwEntrySize) { + m_dwEntrySize = dwEntrySize; + m_dwNoEntries = dwInitialSize; + + m_pStackData = (char*)malloc(dwInitialSize * dwEntrySize); // #TODO: should be void* ? + m_pSetEntry = (char*)malloc(dwEntrySize); + m_pdwRSCData = (DWORD*)malloc(4 * dwInitialSize); + + if (!m_pStackData || !m_pSetEntry || !m_pdwRSCData) + CriticalMsg("Memory Allocation failure!"); + + m_dwStackTop = 0; + m_pCurrentEntry = m_pStackData; + + pcStates->SetPointerToCurrentStates(m_pCurrentEntry); + pcStates->SetPointerToSetStates(m_pSetEntry); } void cD6Renderer::DeleteStatesStack() { + free(m_pSetEntry); + free(m_pStackData); + free(m_pdwRSCData); + + m_pSetEntry = 0; + m_pStackData = 0; + m_pdwRSCData = 0; } -int cD6Renderer::SwitchOverlaysOnOff(BOOL bOn) +BOOL cD6Renderer::SwitchOverlaysOnOff(BOOL bOn) { - return 0; + BOOL bWasOn = m_bOverlaysOn; + m_bOverlaysOn = bOn; + return bWasOn; } void cD6Renderer::StartFrame(int nFrame) { + if (FAILED(g_lpD3Ddevice->BeginScene())) + CriticalMsg("BeginScene failed"); + + pcRenderBuffer->StartFrame(); + + if (g_tmgr) + g_tmgr->start_frame(nFrame); } void cD6Renderer::EndFrame() { + pcRenderBuffer->EndFrame(); + + if (m_bOverlaysOn && pcOverlayHandler) + pcOverlayHandler->DrawOverlays(); + + g_lpD3Ddevice->EndScene(); + + if (g_tmgr) + g_tmgr->end_frame(); } void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) { + int width = 0, height = 0; + + float fX1 = (double)x1 + g_XOffset; + float fX2 = (double)x2 + g_XOffset; + float fY1 = (double)y1 + g_YOffset; + float fY2 = (double)y2 + g_YOffset; + + if (fX1 < 0.0) + fX1 = 0.0; + + if ((double)g_dwScreenWidth < fX2) + { + width = g_dwScreenWidth; + fX2 = (float)g_dwScreenWidth; + } + + if (fY1 < 0.0) + fY1 = 0.0; + + if ((double)g_dwScreenHeight < fY2) + { + height = g_dwScreenHeight; + fY2 = (float)g_dwScreenHeight; + } + +#if 0 + ((void(__thiscall*)(cD6Primitives*, _DWORD, _DWORD, unsigned int, _DWORD, _DWORD, _DWORD, unsigned int, _DWORD, cD6Renderer*))pcRenderBuffer->cD6Primitives::FlushPrimitives)( + pcRenderBuffer, + v5, + HIDWORD(v5), + g_dwScreenHeight, + 0, + v6, + HIDWORD(v6), + g_dwScreenWidth, + 0, + this); +#endif + + BOOL bZWriteOn = pcStates->IsZWriteOn(); + BOOL bZCompareOn = pcStates->IsZCompareOn(); + + if (!bZWriteOn) + pcStates->SetZWrite(TRUE); + + if (bZCompareOn) + pcStates->SetZCompare(FALSE); + + BOOL bAlphaOn = pcStates->IsAlphaBlendingOn(); + pcStates->EnableAlphaBlending(TRUE); + + D3DTLVERTEX* pTLVerts = pcRenderBuffer->ReservePolySlots(4); + memset(pTLVerts, 0, 0x80u); + + for (int i = 0; i < 4; ++i) + { + pTLVerts[i].sz = 1.0; + pTLVerts[i].rhw = 1.0; + } + pTLVerts->sx = fX1; + pTLVerts->sy = fY1; + pTLVerts[1].sx = fX2; + pTLVerts[1].sy = fY1; + pTLVerts[2].sx = fX2; + pTLVerts[2].sy = fY2; + pTLVerts[3].sx = fX1; + pTLVerts[3].sy = fY2; + pcRenderBuffer->DrawPoly(TRUE); + + if (!bZWriteOn) + pcStates->SetZWrite(FALSE); + + if (bZCompareOn) + pcStates->SetZCompare(TRUE); + + if (!bAlphaOn) + pcStates->EnableAlphaBlending(FALSE); } void cD6Renderer::CleanRenderSurface(BOOL bDepthBufferToo) { + DWORD dwFlags = D3DCLEAR_TARGET; + if (bDepthBufferToo) + dwFlags |= D3DCLEAR_ZBUFFER; + + D3DRECT sRect; + sRect.x1 = 0; + sRect.y1 = 0; + sRect.x2 = g_dwScreenWidth; + sRect.y2 = g_dwScreenHeight; + HRESULT hr = g_lpViewport->Clear(1, &sRect, dwFlags); + if (FAILED(hr)) + { + const char* DDErrorMsg = GetDDErrorMsg(hr); + const char* msg = _LogFmt("%s: error %d\n%s", "CleanRenderSurface failed", hr, DDErrorMsg); + CriticalMsg(msg); + } } -long cD6Renderer::InitViewport() +HRESULT cD6Renderer::InitViewport() { - return 0; + Assert_(g_lpViewport); + + D3DVIEWPORT2 vdData; + memset(&vdData, 0, sizeof(vdData)); + vdData.dwSize = 44; + vdData.dwWidth = g_dwScreenWidth; + vdData.dwHeight = g_dwScreenHeight; + vdData.dvClipX = -1.0; + vdData.dvClipWidth = 2.0; + vdData.dvClipY = -1.0; + vdData.dvClipHeight = 2.0; + vdData.dvMaxZ = 1.0; + return g_lpViewport->SetViewport2(&vdData); } diff --git a/libsrc/lgd3d/d6Render.h b/libsrc/lgd3d/d6Render.h index ee89fdc..5936026 100644 --- a/libsrc/lgd3d/d6Render.h +++ b/libsrc/lgd3d/d6Render.h @@ -19,12 +19,12 @@ class cD6Renderer { void DeleteStatesStack(); public: - int SwitchOverlaysOnOff(BOOL bOn); + BOOL SwitchOverlaysOnOff(BOOL bOn); void StartFrame(int nFrame); void EndFrame(); void CleanDepthBuffer(int x1, int y1, int x2, int y2); void CleanRenderSurface(BOOL bDepthBufferToo); - long InitViewport(); + HRESULT InitViewport(); DWORD m_dwEntrySize; DWORD m_dwNoEntries; diff --git a/libsrc/lgd3d/d6States.h b/libsrc/lgd3d/d6States.h index e511d9d..c8ae2bf 100644 --- a/libsrc/lgd3d/d6States.h +++ b/libsrc/lgd3d/d6States.h @@ -195,6 +195,50 @@ class cD6States // cD6States& operator=(const cD6States&); }; +class cImStates : public cD6States +{ +public: + // singleton? + static cD6States* Instance(); + virtual cD6States* DeInstance() override; + +protected: + // cImStates(const class cImStates &); + cImStates(); + virtual ~cImStates(); + +private: + static cImStates* m_Instance; +}; + +class cMSStates : public cD6States { +public: + static cD6States* Instance(); + virtual cD6States* DeInstance() override; + virtual int Initialize(DWORD dwRequestedFlags) override; + virtual int SetDefaultsStates(DWORD dwRequestedFlags) override; + +protected: + // cMSStates(const cMSStates &); + cMSStates(); + virtual ~cMSStates(); + +private: + static cMSStates* m_Instance; + unsigned long m_dwCurrentTexLevel; + int m_bTexturePending; + grs_bitmap* m_LastLightMapBm; + +public: + virtual void set_texture_id(int n) override; + virtual int reload_texture(tdrv_texture_info* info) override; + virtual void cook_info(tdrv_texture_info* info) override; + virtual void SetLightMapMode(DWORD dwFlag) override; + virtual void SetTextureLevel(int n) override; + virtual int EnableMTMode(DWORD dwMTOn) override; + virtual void TurnOffTexuring(BOOL bTexOff) override; +}; + #define SetRenderStateForGlobal(dev, key, value) \ if (hRes = dev->SetRenderState(key, value), hRes != S_OK) \ diff --git a/libsrc/lgd3d/d6sts_s.cpp b/libsrc/lgd3d/d6sts_s.cpp index b99b37b..ff1fdc0 100644 --- a/libsrc/lgd3d/d6sts_s.cpp +++ b/libsrc/lgd3d/d6sts_s.cpp @@ -51,50 +51,6 @@ extern cD6Primitives* pcRenderBuffer; extern cD6Renderer* pcRenderer; cD6States *pcStates = nullptr; -class cImStates : public cD6States -{ -public: - // singleton? - static cD6States* Instance(); - virtual cD6States *DeInstance() override; - -protected: - // cImStates(const class cImStates &); - cImStates(); - virtual ~cImStates(); - -private: - static cImStates *m_Instance; -}; - -class cMSStates : public cD6States { -public: - static cD6States * Instance(); - virtual cD6States * DeInstance() override; - virtual int Initialize(DWORD dwRequestedFlags) override; - virtual int SetDefaultsStates(DWORD dwRequestedFlags) override; - -protected: - // cMSStates(const cMSStates &); - cMSStates(); - virtual ~cMSStates(); - -private: - static cMSStates * m_Instance; - unsigned long m_dwCurrentTexLevel; - int m_bTexturePending; - grs_bitmap * m_LastLightMapBm; - -public: - virtual void set_texture_id(int n) override; - virtual int reload_texture(tdrv_texture_info *info) override; - virtual void cook_info(tdrv_texture_info *info) override; - virtual void SetLightMapMode(DWORD dwFlag) override; - virtual void SetTextureLevel(int n) override; - virtual int EnableMTMode(DWORD dwMTOn) override; - virtual void TurnOffTexuring(BOOL bTexOff) override; -}; - #define PF_GENERIC 0 #define PF_RGB 1 #define PF_ALPHA 2 @@ -1843,7 +1799,7 @@ BOOL cD6States::EnableSpecular(BOOL bUseIt) cD6States* cImStates::Instance() { if (m_Instance == NULL) - m_Instance = new cImStates; + m_Instance = new cImStates(); return m_Instance; } @@ -1922,7 +1878,7 @@ cImStates::~cImStates() cD6States* cMSStates::Instance() { if (m_Instance == NULL) - m_Instance = new cMSStates; + m_Instance = new cMSStates(); return m_Instance; } From d77d1d3135c8967066508350c3a598710f9c590b Mon Sep 17 00:00:00 2001 From: Kirill Yurkin <47507219+ugozapad@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:48:34 +0300 Subject: [PATCH 27/35] Update d6Render.cpp --- libsrc/lgd3d/d6Render.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp index 4276f7d..527e5b1 100644 --- a/libsrc/lgd3d/d6Render.cpp +++ b/libsrc/lgd3d/d6Render.cpp @@ -195,19 +195,7 @@ void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) fY2 = (float)g_dwScreenHeight; } -#if 0 - ((void(__thiscall*)(cD6Primitives*, _DWORD, _DWORD, unsigned int, _DWORD, _DWORD, _DWORD, unsigned int, _DWORD, cD6Renderer*))pcRenderBuffer->cD6Primitives::FlushPrimitives)( - pcRenderBuffer, - v5, - HIDWORD(v5), - g_dwScreenHeight, - 0, - v6, - HIDWORD(v6), - g_dwScreenWidth, - 0, - this); -#endif + pcRenderBuffer->FlushPrimitives(); BOOL bZWriteOn = pcStates->IsZWriteOn(); BOOL bZCompareOn = pcStates->IsZCompareOn(); From 50c10f7cd23a714b3968aff1550de9a459f29206 Mon Sep 17 00:00:00 2001 From: Kirill Yurkin <47507219+ugozapad@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:48:05 +0300 Subject: [PATCH 28/35] Partial implement of cD6Primitives --- libsrc/lgd3d/d6Prim.cpp | 853 +++++++++++++++++++++++++++++ libsrc/lgd3d/d6Prim.h | 18 +- libsrc/lgd3d/d6Render.cpp | 2 +- libsrc/lgd3d/lgd3d.vcxproj | 1 + libsrc/lgd3d/lgd3d.vcxproj.filters | 3 + 5 files changed, 867 insertions(+), 10 deletions(-) create mode 100644 libsrc/lgd3d/d6Prim.cpp diff --git a/libsrc/lgd3d/d6Prim.cpp b/libsrc/lgd3d/d6Prim.cpp new file mode 100644 index 0000000..7cb05d3 --- /dev/null +++ b/libsrc/lgd3d/d6Prim.cpp @@ -0,0 +1,853 @@ +#include +#include "d6Prim.h" +#include "d6States.h" + +typedef struct { + double left; + double top; + double right; + double bot; +} cliprect; + +cliprect lgd3d_clip; +uint16 waEdgeIndices[50]; + +extern float g_XOffset; +extern float g_YOffset; + +extern "C" { + extern BOOL zlinear; +} + +uint16 hack_light_alpha_pal[16] = +{ + 4095u, + 8191u, + 12287u, + 16383u, + 20479u, + 24575u, + 28671u, + 32767u, + 36863u, + 40959u, + 45055u, + 49151u, + 53247u, + 57343u, + 61439u, + 65535u +}; // idb + +double z_near = 1.0; // idb +double z_far = 200.0; // idb +double inv_z_far = 0.005; // idb +double z1 = 1.005025125628141; // idb +double z2 = 1.005025125628141; // idb +double z2d = 1.0; // idb +double w2d = 1.0; // idb + +cD6Primitives::cD6Primitives() +{ + m_bFlushingOn = 0; + m_bPointMode = 0; + m_ePolyMode = kLgd3dPolyModeFillWTexture; + m_dwNoCashedPoints = 0; + m_dwPointBufferSize = 50; + m_dwNoCashedVertices = 0; + m_dwVertexBufferSize = 50; + m_pVIB = 0; + m_hack_light_bm = 0; + + memset(m_saVertexBuffer, 0, sizeof(m_saVertexBuffer)); + + for (int i = 0; i < 50; ++i) + waEdgeIndices[i] = i; + + CreateVertIndBuffer(16); + + lgd3d_release_ip_func = lgd3d_release_indexed_primitives; +} + +cD6Primitives::~cD6Primitives() +{ + if (m_hack_light_bm) + { + if (g_tmgr) + g_tmgr->unload_texture(m_hack_light_bm); + + gr_free(m_hack_light_bm); + m_hack_light_bm = 0; + } + + DeleteVertIndBuffer(); + + lgd3d_release_ip_func = 0; +} + +cD6Primitives* cD6Primitives::DeInstance() +{ + return nullptr; +} + +D3DTLVERTEX* cD6Primitives::ReservePolySlots(unsigned int n) +{ + if (m_bPointMode) + { + FlushPoints(); + m_bPointMode = 0; + } + + if (n > m_dwVertexBufferSize) + CriticalMsg("ReservePolySlots(): poly too large!"); + + m_dwNoCashedVertices = n; + + return m_saVertexBuffer; +} + +void cD6Primitives::DrawPoly(BOOL bSuspendTexturing) +{ + if ((m_ePolyMode & kLgd3dPolyModeFillWColor) != 0) + bSuspendTexturing = 1; + + if (bSuspendTexturing != g_bTexSuspended) + { + FlushIndPolies(); + + if (bSuspendTexturing) + StartNonTexMode(); + else + EndNonTexMode(); + } + + if (!lgd3d_punt_d3d) + { + if ((m_ePolyMode & 3) != 0) + { + HRESULT hResult = g_lpD3Ddevice->DrawPrimitive( + D3DPT_TRIANGLEFAN, + 452, + m_saVertexBuffer, + m_dwNoCashedVertices, + 12); + + if (FAILED(hResult)) + { + const char* DDErrorMsg = GetDDErrorMsg(hResult); + const char* msg = _LogFmt("%s: error %d\n%s ", "DrawPrimitive failed", hResult, DDErrorMsg); + CriticalMsg(msg); + } + } + + if ((m_ePolyMode & kLgd3dPolyModeDrawEdges) != 0) + DrawStandardEdges(m_saVertexBuffer, m_dwNoCashedVertices); + } +} + +BOOL cD6Primitives::Poly(int n, r3s_point** ppl) +{ + _r3s_point* _src; // [esp+8h] [ebp-1Ch] + D3DTLVERTEX* _dest; // [esp+Ch] [ebp-18h] + int _sy; // [esp+10h] [ebp-14h] + int _sx; // [esp+14h] [ebp-10h] + int c0; // [esp+20h] [ebp-4h] + + c0 = pcStates->get_color(); + D3DTLVERTEX* vlist = ReservePolySlots(n); + for (int j = 0; j < n; ++j) + { + vlist[j].color = c0; + vlist[j].specular = m_dcFogSpecular; + _dest = &vlist[j]; + _src = ppl[j]; + _sx = _src->grp.sx + 0x8000; + _sy = _src->grp.sy + 0x8000; + if (_sx > grd_canvas->gc.clip.f.right) + _sx = grd_canvas->gc.clip.f.right; + if (_sx < grd_canvas->gc.clip.f.left) + _sx = grd_canvas->gc.clip.f.left; + if (_sy > grd_canvas->gc.clip.f.bot) + _sy = grd_canvas->gc.clip.f.bot; + if (_sy < grd_canvas->gc.clip.f.top) + _sy = grd_canvas->gc.clip.f.top; + _dest->sx = (double)_sx / 65536.0 + g_XOffset; + _dest->sy = (double)_sy / 65536.0 + g_YOffset; + if (zlinear) + { + _dest->sz = z2d; + } + else if (lgd3d_z_normal) + { + _dest->sz = _src->p.z * inv_z_far; + } + else + { + _dest->sz = z1 - _src->grp.w * z2; + _dest->rhw = _src->grp.w; + if (_dest->sz <= 1.0) + { + if (_dest->sz < 0.0) + _dest->sz = 0.0; + } + else + { + _dest->sz = 1.0; + } + } + } + + DrawPoly(TRUE); + + return 0; +} + +ePolyMode cD6Primitives::GetPolyMode() +{ + return m_ePolyMode; +} + +BOOL cD6Primitives::SetPolyMode(ePolyMode eNewMode) +{ + if ((eNewMode & 7) == 0) + return FALSE; + + if (m_ePolyMode != eNewMode) + FlushPrimitives(); + + m_ePolyMode = eNewMode; + + return TRUE; +} + +void cD6Primitives::DrawStandardEdges(void* pVertera, unsigned int dwNoVeriteces) +{ + if (!g_bTexSuspended) + { + FlushIndPolies(); + StartNonTexMode(); + } + + waEdgeIndices[dwNoVeriteces] = 0; + + HRESULT hResult = g_lpD3Ddevice->DrawIndexedPrimitive( + D3DPT_LINESTRIP, + 452u, + pVertera, + dwNoVeriteces, + waEdgeIndices, + dwNoVeriteces + 1, + 12u); + + waEdgeIndices[dwNoVeriteces] = dwNoVeriteces; + + if (FAILED(hResult)) + { + const char* DDErrorMsg = GetDDErrorMsg(hResult); + const char* msg = _LogFmt("%s: error %d\n%s ", "DrawStandardEdges failed", hResult, DDErrorMsg); + CriticalMsg(msg); + } +} + +void cD6Primitives::FlushPrimitives() +{ + if (m_bPrimitivesPending) + { + if (!m_bFlushingOn) + { + m_bFlushingOn = TRUE; + + FlushIndPolies(); + FlushPoints(); + + m_bPrimitivesPending = FALSE; + m_bFlushingOn = FALSE; + } + } +} + +void cD6Primitives::StartFrame() +{ + lgd3d_clip.left = (double)grd_canvas->gc.clip.f.left / 65536.0 + g_XOffset; + lgd3d_clip.right = (double)grd_canvas->gc.clip.f.right / 65536.0 + g_XOffset; + lgd3d_clip.top = (double)grd_canvas->gc.clip.f.top / 65536.0 + g_YOffset; + lgd3d_clip.bot = (double)grd_canvas->gc.clip.f.bot / 65536.0 + g_YOffset; + + pcStates->EnableFog(FALSE); + pcStates->SetFogSpecularLevel(0.0f); + + m_dwNoCashedPoints = 0; + + g_bTexSuspended = FALSE; +} + +void cD6Primitives::EndFrame() +{ + FlushPrimitives(); + EndIndexedRun(); +} + +void cD6Primitives::Clear(int c) +{ + int fc_save = grd_canvas->gc.fcolor; + + D3DTLVERTEX* vlist = ReservePolySlots(4); + + grd_canvas->gc.fcolor = c; + + int ca = pcStates->get_color(); + + grd_canvas->gc.fcolor = fc_save; + + float x0 = (double)grd_canvas->gc.clip.f.left / 65536.0 + g_XOffset; + float x1 = (double)grd_canvas->gc.clip.f.right / 65536.0 + g_XOffset; + float y0 = (double)grd_canvas->gc.clip.f.top / 65536.0 + g_YOffset; + float y1 = (double)grd_canvas->gc.clip.f.bot / 65536.0 + g_YOffset; + + for (int i = 0; i < 4; ++i) + { + float v3 = z2d; + vlist[i].sz = v3; + float v2 = w2d; + vlist[i].rhw = v2; + vlist[i].color = ca; + vlist[i].specular = m_dcFogSpecular; + } + + vlist[0].sx = x0; + vlist[0].sy = y0; + vlist[1].sx = x1; + vlist[1].sy = y0; + vlist[2].sx = x1; + vlist[2].sy = y1; + vlist[3].sx = x0; + vlist[3].sy = y1; + + DrawPoly(TRUE); +} + +void cD6Primitives::StartNonTexMode() +{ + m_iSavedTexId = pcStates->get_texture_id(); + if (m_iSavedTexId != -1) + pcStates->TurnOffTexuring(TRUE); +} + +void cD6Primitives::EndNonTexMode() +{ + if (m_iSavedTexId != -1) + pcStates->TurnOffTexuring(FALSE); +} + +void cD6Primitives::DrawIndPolies() +{ + if (m_dwTempIndCounter <= 2) + { + const char* msg = _LogFmt("A poly has more than %d points!", m_dwTempIndCounter); + CriticalMsg(msg); + } + + m_waIndices[m_dwNoIndices] = m_waTempIndices[0]; + m_waIndices[m_dwNoIndices + 1] = m_waTempIndices[1]; + m_waIndices[m_dwNoIndices + 2] = m_waTempIndices[2]; + m_dwNoIndices += 3; + + for (int i = 3; i < m_dwTempIndCounter; ++i) + { + m_waIndices[m_dwNoIndices] = m_waTempIndices[0]; + m_waIndices[m_dwNoIndices + 1] = *((WORD*)&m_dwNoIndices + i + 1); + m_waIndices[m_dwNoIndices + 2] = m_waTempIndices[i]; + m_dwNoIndices += 3; + } + + m_dwTempIndCounter = 0; + m_bPrimitivesPending = TRUE; +} + +D3DTLVERTEX* cD6Primitives::ReservePointSlots(int n) +{ + if (!m_bPointMode) + { + FlushIndPolies(); + m_bPointMode = TRUE; + } + + if (n + m_dwNoCashedPoints > m_dwPointBufferSize) + FlushPoints(); + + if (n + m_dwNoCashedPoints > m_dwPointBufferSize) + CriticalMsg("ReservePointSlots(): too many points!"); + + D3DTLVERTEX* retval = &m_saPointBuffer[m_dwNoCashedPoints]; + m_dwNoCashedPoints += n; + m_bPrimitivesPending = TRUE; + return retval; +} + +void cD6Primitives::FlushPoints() +{ + if (m_dwNoCashedPoints) + { + if (!g_bTexSuspended) + StartNonTexMode(); + + HRESULT hResult = g_lpD3Ddevice->DrawPrimitive( + D3DPT_POINTLIST, + 452u, + m_saPointBuffer, + m_dwNoCashedPoints, + 12u); + + if (FAILED(hResult)) + { + const char* DDErrorMsg = GetDDErrorMsg(hResult); + const char* msg = _LogFmt("%s: error %d\n%s ", "DrawPrimitive(points) failed", hResult, DDErrorMsg); + CriticalMsg(msg); + } + + m_dwNoCashedPoints = 0; + } +} + +void cD6Primitives::DrawLine(r3s_point* p0, r3s_point* p1) +{ + _r3s_point* v4; // [esp+4h] [ebp-44h] + _r3s_point* tmp; // [esp+8h] [ebp-40h] + _D3DTLVERTEX* __dest; // [esp+Ch] [ebp-3Ch] + int left; // [esp+10h] [ebp-38h] + int top; // [esp+14h] [ebp-34h] + float y1; // [esp+18h] [ebp-30h] + float y0; // [esp+1Ch] [ebp-2Ch] + _D3DTLVERTEX* vlist; // [esp+20h] [ebp-28h] + int i; // [esp+24h] [ebp-24h] + int temp; // [esp+28h] [ebp-20h] + int tempa; // [esp+28h] [ebp-20h] + int tempb; // [esp+28h] [ebp-20h] + int tempc; // [esp+28h] [ebp-20h] + float x1; // [esp+2Ch] [ebp-1Ch] + int bot; // [esp+30h] [ebp-18h] + float x0; // [esp+34h] [ebp-14h] + int right; // [esp+38h] [ebp-10h] + int c; // [esp+3Ch] [ebp-Ch] + int x10; // [esp+40h] [ebp-8h] + int y10; // [esp+44h] [ebp-4h] + + c = (this->m_nAlpha << 24) | pcStates->get_color(); + left = grd_canvas->gc.clip.f.left; + right = grd_canvas->gc.clip.f.right; + top = grd_canvas->gc.clip.f.top; + bot = grd_canvas->gc.clip.f.bot; + if (bot - top >= 0x10000 && right - left >= 0x10000) + { + vlist = ReservePolySlots(4u); + for (i = 0; i < 4; ++i) + { + vlist[i].color = c; + vlist[i].specular = this->m_dcFogSpecular; + __dest = &vlist[i]; + if (zlinear) + { + __dest->sz = z2d; + } + else if (lgd3d_z_normal) + { + __dest->sz = p0->p.z * inv_z_far; + } + else + { + __dest->sz = z1 - p0->grp.w * z2; + __dest->rhw = p0->grp.w; + if (__dest->sz <= 1.0) + { + if (__dest->sz < 0.0) + __dest->sz = 0.0; + } + else + { + __dest->sz = 1.0; + } + } + vlist[i].tv = 0.0; + vlist[i].tu = 0.0; + } + x10 = p1->grp.sx - p0->grp.sx; + y10 = p1->grp.sy - p0->grp.sy; + if (x10 < 0) + x10 = p0->grp.sx - p1->grp.sx; + if (y10 < 0) + y10 = p0->grp.sy - p1->grp.sy; + if (y10 <= x10) + { + top += 0x8000; + bot -= 0x8000; + if (p0->grp.sx > p1->grp.sx) + { + v4 = p0; + p0 = p1; + p1 = v4; + } + } + else + { + left += 0x8000; + right -= 0x8000; + if (p0->grp.sy > p1->grp.sy) + { + tmp = p0; + p0 = p1; + p1 = tmp; + } + } + temp = p0->grp.sx + 0x8000; + if (temp < left) + temp = left; + if (temp > right) + temp = right; + x0 = (double)temp / 65536.0 + g_XOffset; + tempa = p1->grp.sx + 0x8000; + if (tempa < left) + tempa = left; + if (tempa > right) + tempa = right; + x1 = (double)tempa / 65536.0 + g_XOffset; + tempb = p0->grp.sy + 0x8000; + if (tempb < top) + tempb = top; + if (tempb > bot) + tempb = bot; + y0 = (double)tempb / 65536.0 + g_YOffset; + tempc = p1->grp.sy + 0x8000; + if (tempc < top) + tempc = top; + if (tempc > bot) + tempc = bot; + y1 = (double)tempc / 65536.0 + g_YOffset; + if (y10 <= x10) + { + vlist->sy = y0 + 0.5; + vlist[1].sy = y0 - 0.5; + vlist[2].sy = y1 - 0.5; + vlist[3].sy = y1 + 0.5; + vlist->sx = x0; + vlist[1].sx = x0; + vlist[2].sx = x1; + vlist[3].sx = x1; + } + else + { + vlist->sx = x0 - 0.5; + vlist[1].sx = x0 + 0.5; + vlist[2].sx = x1 + 0.5; + vlist[3].sx = x1 - 0.5; + vlist->sy = y0; + vlist[1].sy = y0; + vlist[2].sy = y1; + vlist[3].sy = y1; + } + + DrawPoly(TRUE); + } +} + +void cD6Primitives::InitializeVIBCounters() +{ + m_dwNoVIBEntries = 0; + m_dwNoIndices = 0; + m_dwTempIndCounter = 0; + m_dwMinVIndex = 256; + m_dwMaxVIndex = 0; +} + +int cD6Primitives::CreateVertIndBuffer(DWORD dwInitialNoEntries) +{ + DeleteVertIndBuffer(); + + m_dwVIBSizeInEntries = dwInitialNoEntries; + + m_pVIB = (D3DTLVERTEX*)malloc(sizeof(D3DTLVERTEX) * m_dwVIBSizeInEntries); + InitializeVIBCounters(); + + m_dwVIBmax = 256; + + return m_pVIB != 0; +} + +void cD6Primitives::init_hack_light_bm() +{ + m_hack_light_bm = gr_alloc_bitmap(2u, 2u, 32, 32); + uchar* bits = m_hack_light_bm->bits; + for (int i = 0; i < 32; ++i) + { + for (int j = 0; j < 32; ++j) + { + uchar val = 0; + + float alpha = 128.0 / (((double)i - 15.5) * ((double)i - 15.5) + ((double)j - 15.5) * ((double)j - 15.5)); \ + if (alpha <= 15.0) + val = (__int64)alpha; + else + val = 15; + + bits[j] = val; + } + + bits += 32; + } +} + +void cD6Primitives::do_quad_light(r3s_point* p, float r, grs_bitmap* bm) +{ + float y_top; // [esp+14h] [ebp-34h] + float v_bot; // [esp+18h] [ebp-30h] + _D3DTLVERTEX* vl; // [esp+1Ch] [ebp-2Ch] + float y; // [esp+20h] [ebp-28h] + float x; // [esp+24h] [ebp-24h] + unsigned int fog_specular; // [esp+28h] [ebp-20h] + float x_left; // [esp+2Ch] [ebp-1Ch] + float x_right; // [esp+30h] [ebp-18h] + float y_bot; // [esp+34h] [ebp-14h] + unsigned int c; // [esp+38h] [ebp-10h] + float u_left; // [esp+3Ch] [ebp-Ch] + float u_right; // [esp+40h] [ebp-8h] + float v_top; // [esp+44h] [ebp-4h] + + x = (double)p->grp.sx / 65536.0 + g_XOffset; + y = (double)p->grp.sy / 65536.0 + g_YOffset; + if (x + r >= lgd3d_clip.left && x - r <= lgd3d_clip.right && y + r >= lgd3d_clip.top && y - r <= lgd3d_clip.bot) + { + c = pcStates->get_color() | 0xFF000000; + fog_specular = this->m_dcFogSpecular; + grd_canvas->gc.fill_type = 3; + pcStates->SetAlphaPalette(hack_light_alpha_pal); + if (g_tmgr) + g_tmgr->set_texture(bm); + vl = ReservePolySlots(4u); + x_right = x + r; + x_left = x - r; + u_left = 0.0; + u_right = 1.0; + if (x_left < (double)lgd3d_clip.left) + { + u_left = (lgd3d_clip.left - x_left) / (2.0 * r); + x_left = lgd3d_clip.left; + } + if (x_right > (double)lgd3d_clip.right) + { + u_right = (1.0 - u_left) * (lgd3d_clip.right - x_left) / (x_right - x_left) + u_left; + x_right = lgd3d_clip.right; + } + y_bot = y + r; + y_top = y - r; + v_top = 0.0; + v_bot = 1.0; + if (y_top < (double)lgd3d_clip.top) + { + v_top = (lgd3d_clip.top - y_top) / (2.0 * r); + y_top = lgd3d_clip.top; + } + if (y_bot > (double)lgd3d_clip.bot) + { + v_bot = v_top + (1.0 - v_top) * (lgd3d_clip.bot - y_top) / (y_bot - y_top); + y_bot = lgd3d_clip.bot; + } + vl->tu = u_left; + vl->tv = v_top; + vl->sx = x_left; + vl->sy = y_top; + vl->color = c; + vl->specular = fog_specular; + if (zlinear) + { + vl->sz = z2d; + } + else if (lgd3d_z_normal) + { + vl->sz = p->p.z * inv_z_far; + } + else + { + vl->sz = z1 - p->grp.w * z2; + vl->rhw = p->grp.w; + if (vl->sz <= 1.0) + { + if (vl->sz < 0.0) + vl->sz = 0.0; + } + else + { + vl->sz = 1.0; + } + } + vl[1].tu = u_right; + vl[1].tv = v_top; + vl[1].sx = x_right; + vl[1].sy = y_top; + vl[1].color = c; + vl[1].specular = fog_specular; + if (zlinear) + { + vl[1].sz = z2d; + } + else if (lgd3d_z_normal) + { + vl[1].sz = p->p.z * inv_z_far; + } + else + { + vl[1].sz = z1 - p->grp.w * z2; + vl[1].rhw = p->grp.w; + if (vl[1].sz <= 1.0) + { + if (vl[1].sz < 0.0) + vl[1].sz = 0.0; + } + else + { + vl[1].sz = 1.0; + } + } + vl[2].tu = u_right; + vl[2].tv = v_bot; + vl[2].sx = x_right; + vl[2].sy = y_bot; + vl[2].color = c; + vl[2].specular = fog_specular; + if (zlinear) + { + vl[2].sz = z2d; + } + else if (lgd3d_z_normal) + { + vl[2].sz = p->p.z * inv_z_far; + } + else + { + vl[2].sz = z1 - p->grp.w * z2; + vl[2].rhw = p->grp.w; + if (vl[2].sz <= 1.0) + { + if (vl[2].sz < 0.0) + vl[2].sz = 0.0; + } + else + { + vl[2].sz = 1.0; + } + } + vl[3].tu = u_left; + vl[3].tv = v_bot; + vl[3].sx = x_left; + vl[3].sy = y_bot; + vl[3].color = c; + vl[3].specular = fog_specular; + if (zlinear) + { + vl[3].sz = z2d; + } + else if (lgd3d_z_normal) + { + vl[3].sz = p->p.z * inv_z_far; + } + else + { + vl[3].sz = z1 - p->grp.w * z2; + vl[3].rhw = p->grp.w; + if (vl[3].sz <= 1.0) + { + if (vl[3].sz < 0.0) + vl[3].sz = 0.0; + } + else + { + vl[3].sz = 1.0; + } + } + + DrawPoly(FALSE); + + grd_canvas->gc.fill_type = 0; + } +} + +void cD6Primitives::HackLight(r3s_point* p, float r) +{ + if (r > 1.0) + { + if (!m_hack_light_bm) + init_hack_light_bm(); + + do_quad_light(p, r, m_hack_light_bm); + } + else + { + DrawPoint(p); + } +} + +cMSBuffer::cMSBuffer() +{ + m_dwMaxNoMTVertices = 50; +} + +cMSBuffer::~cMSBuffer() +{ +} + +cD6Primitives* cMSBuffer::Instance() +{ + if (!m_Instance) + { + m_Instance = new cMSBuffer(); + } + + return m_Instance; +} + +void cMSBuffer::DrawPoly(BOOL bSuspendTexturing) +{ + if ((m_ePolyMode & 2) != 0) + bSuspendTexturing = 1; + + if (bSuspendTexturing != g_bTexSuspended) + { + FlushIndPolies(); + + if (bSuspendTexturing) + StartNonTexMode(); + else + EndNonTexMode(); + } + + if ((g_bTexSuspended || pcStates->EnableMTMode(0)) && !lgd3d_punt_d3d) + { + if ((m_ePolyMode & 3) != 0) + { + HRESULT hResult = g_lpD3Ddevice->DrawPrimitive( + D3DPT_TRIANGLEFAN, + 452u, + m_saVertexBuffer, + m_dwNoCashedVertices, + 12u); + + if (FAILED(hResult)) + { + const char* DDErrorMsg = GetDDErrorMsg(hResult); + const char* msg = _LogFmt("%s: error %d\n%s ", "DrawPrimitive(poly) failed", hResult, DDErrorMsg); + CriticalMsg(msg); + } + } + + if ((m_ePolyMode & kLgd3dPolyModeDrawEdges) != 0) + DrawStandardEdges(m_saVertexBuffer, m_dwNoCashedVertices); + } +} + +MTVERTEX* cMSBuffer::ReserveMTPolySlots(int n) +{ + if (n > m_dwMaxNoMTVertices) + CriticalMsg("ReservePolySlots(): poly too large!"); + + m_dwNoMTVertices = n; + + return m_saMTVertices; +} diff --git a/libsrc/lgd3d/d6Prim.h b/libsrc/lgd3d/d6Prim.h index 98b652f..296ca14 100644 --- a/libsrc/lgd3d/d6Prim.h +++ b/libsrc/lgd3d/d6Prim.h @@ -22,18 +22,18 @@ class cD6Primitives { public: virtual cD6Primitives * DeInstance(); -private: - int m_bPrimitivesPending; - int m_bFlushingOn; +protected: + BOOL m_bPrimitivesPending; + BOOL m_bFlushingOn; int m_nAlpha; unsigned long m_dcFogSpecular; - int m_bPointMode; + BOOL m_bPointMode; int m_iSavedTexId; enum ePolyMode m_ePolyMode; public: ePolyMode GetPolyMode(); - int SetPolyMode(ePolyMode eNewMode); + BOOL SetPolyMode(ePolyMode eNewMode); protected: void DrawStandardEdges(void *pVertera, unsigned int dwNoVeriteces); @@ -48,7 +48,7 @@ class cD6Primitives { virtual void StartNonTexMode(); virtual void EndNonTexMode(); -private: +protected: unsigned long m_dwNoCashedPoints; unsigned long m_dwPointBufferSize; D3DTLVERTEX m_saPointBuffer[50]; @@ -58,15 +58,15 @@ class cD6Primitives { unsigned long m_dwVertexBufferSize; public: - virtual D3DTLVERTEX * ReservePointSlots(int n); + virtual D3DTLVERTEX* ReservePointSlots(int n); virtual void FlushPoints(); void SetPointBufferSize(unsigned long); // static? unsigned long GetPointBufferSize(); // static? virtual int DrawPoint(r3s_point *p); - D3DTLVERTEX * ReservePolySlots(int n); + D3DTLVERTEX* ReservePolySlots(unsigned int n); virtual void DrawPoly(BOOL bSuspendTexturing); - virtual int Poly(int n, r3s_point * * ppl); + virtual BOOL Poly(int n, r3s_point * * ppl); virtual int SPoly(int n, r3s_point * * ppl); virtual int RGB_Poly(int n, r3s_point * * ppl); virtual int RGBA_Poly(int n, r3s_point * * ppl); diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp index 527e5b1..2a28516 100644 --- a/libsrc/lgd3d/d6Render.cpp +++ b/libsrc/lgd3d/d6Render.cpp @@ -210,7 +210,7 @@ void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) pcStates->EnableAlphaBlending(TRUE); D3DTLVERTEX* pTLVerts = pcRenderBuffer->ReservePolySlots(4); - memset(pTLVerts, 0, 0x80u); + memset(pTLVerts, 0, sizeof(D3DTLVERTEX) * 4); for (int i = 0; i < 4; ++i) { diff --git a/libsrc/lgd3d/lgd3d.vcxproj b/libsrc/lgd3d/lgd3d.vcxproj index e5c9fb7..ad4daa9 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj +++ b/libsrc/lgd3d/lgd3d.vcxproj @@ -24,6 +24,7 @@ + diff --git a/libsrc/lgd3d/lgd3d.vcxproj.filters b/libsrc/lgd3d/lgd3d.vcxproj.filters index f66bbe2..e12641d 100644 --- a/libsrc/lgd3d/lgd3d.vcxproj.filters +++ b/libsrc/lgd3d/lgd3d.vcxproj.filters @@ -77,5 +77,8 @@ Source Files + + Source Files + \ No newline at end of file From 0e15671431b110c1a600aae683ad3a8997a6928e Mon Sep 17 00:00:00 2001 From: Dmitry Pankov Date: Fri, 30 Aug 2024 20:35:58 +0300 Subject: [PATCH 29/35] Apply cD6Renderer suggestions from code review --- libsrc/lgd3d/d6Render.cpp | 59 ++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/libsrc/lgd3d/d6Render.cpp b/libsrc/lgd3d/d6Render.cpp index 2a28516..850f38e 100644 --- a/libsrc/lgd3d/d6Render.cpp +++ b/libsrc/lgd3d/d6Render.cpp @@ -12,27 +12,21 @@ extern DWORD g_dwScreenHeight; extern float g_XOffset; extern float g_YOffset; -#define _BYTE uint8 -#define BYTEn(x, n) (*((_BYTE*)&(x)+n)) -#define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0) cD6Renderer::cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) { m_bOverlaysOn = TRUE; - if (dwInitialBufferType) - { - if (dwInitialBufferType == 1) - { - pcRenderBuffer = cMSBuffer::Instance(); - pcStates = cMSStates::Instance(); - } - } - else + if (dwInitialBufferType == 0) { pcRenderBuffer = cImBuffer::Instance(); pcStates = cImStates::Instance(); } + else if (dwInitialBufferType == 1) + { + pcRenderBuffer = cMSBuffer::Instance(); + pcStates = cMSStates::Instance(); + } DWORD RenderStatesSize = pcStates->GetRenderStatesSize(); CreateStatesStack(10, RenderStatesSize); @@ -40,8 +34,8 @@ cD6Renderer::cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) { if (dwInitialBufferType != 1) { - lgd3d_g_bInitialized = 0; - DbgReportWarning("Could not Initialize D3D states\n"); + lgd3d_g_bInitialized = FALSE; + Warning(("Could not Initialize D3D states\n")); } pcStates->DeInstance(); @@ -50,24 +44,21 @@ cD6Renderer::cD6Renderer(DWORD dwInitialBufferType, DWORD* pdwRequestedFlags) DeleteStatesStack(); // bit flag? - DWORD v4 = *pdwRequestedFlags; - BYTE1(v4) = BYTE1(*pdwRequestedFlags) & 0xFE; - *pdwRequestedFlags = v4; + pdwRequestedFlags ~= 0x100; pcRenderBuffer = cImBuffer::Instance(); pcStates = cImStates::Instance(); - DWORD v5 = pcStates->GetRenderStatesSize(); - CreateStatesStack(10, v5); + CreateStatesStack(10, pcStates->GetRenderStatesSize()); if (pcStates->Initialize(*pdwRequestedFlags)) { - DbgReportWarning("Can not use multitextures. Reverting to single texture mode.\n"); + Warning(("Can not use multitextures. Reverting to single texture mode.\n")); } else { - lgd3d_g_bInitialized = 0; - DbgReportWarning("Could not Initialize D3D states\n"); + lgd3d_g_bInitialized = FALSE; + Warning(("Could not Initialize D3D states\n")); } } } @@ -114,7 +105,7 @@ void cD6Renderer::CreateStatesStack(DWORD dwInitialSize, DWORD dwEntrySize) m_pStackData = (char*)malloc(dwInitialSize * dwEntrySize); // #TODO: should be void* ? m_pSetEntry = (char*)malloc(dwEntrySize); - m_pdwRSCData = (DWORD*)malloc(4 * dwInitialSize); + m_pdwRSCData = (DWORD*)malloc(sizeof(DWORD) * dwInitialSize); if (!m_pStackData || !m_pSetEntry || !m_pdwRSCData) CriticalMsg("Memory Allocation failure!"); @@ -132,9 +123,9 @@ void cD6Renderer::DeleteStatesStack() free(m_pStackData); free(m_pdwRSCData); - m_pSetEntry = 0; - m_pStackData = 0; - m_pdwRSCData = 0; + m_pSetEntry = nullptr; + m_pStackData = nullptr; + m_pdwRSCData = nullptr; } BOOL cD6Renderer::SwitchOverlaysOnOff(BOOL bOn) @@ -172,18 +163,18 @@ void cD6Renderer::CleanDepthBuffer(int x1, int y1, int x2, int y2) { int width = 0, height = 0; - float fX1 = (double)x1 + g_XOffset; - float fX2 = (double)x2 + g_XOffset; - float fY1 = (double)y1 + g_YOffset; - float fY2 = (double)y2 + g_YOffset; + float fX1 = x1 + g_XOffset; + float fX2 = x2 + g_XOffset; + float fY1 = y1 + g_YOffset; + float fY2 = y2 + g_YOffset; if (fX1 < 0.0) fX1 = 0.0; - if ((double)g_dwScreenWidth < fX2) + if (g_dwScreenWidth < fX2) { width = g_dwScreenWidth; - fX2 = (float)g_dwScreenWidth; + fX2 = g_dwScreenWidth; } if (fY1 < 0.0) @@ -251,9 +242,7 @@ void cD6Renderer::CleanRenderSurface(BOOL bDepthBufferToo) HRESULT hr = g_lpViewport->Clear(1, &sRect, dwFlags); if (FAILED(hr)) { - const char* DDErrorMsg = GetDDErrorMsg(hr); - const char* msg = _LogFmt("%s: error %d\n%s", "CleanRenderSurface failed", hr, DDErrorMsg); - CriticalMsg(msg); + CriticalMsg2("%s: error %d\n%s", "CleanRenderSurface failed", hr, GetDDErrorMsg(hr)); } } From d00ceeff62171d387ef8dda5832e3fa726dc755e Mon Sep 17 00:00:00 2001 From: Dmitry Pankov Date: Sat, 28 Sep 2024 10:48:38 +0300 Subject: [PATCH 30/35] update dbgdrom files --- DBGDROM.EXE.c | 9876 +++++++++++++++++++++++-------------------------- DBGDROM.EXE.h | 842 +++-- 2 files changed, 5103 insertions(+), 5615 deletions(-) diff --git a/DBGDROM.EXE.c b/DBGDROM.EXE.c index 47955bd..24349be 100644 --- a/DBGDROM.EXE.c +++ b/DBGDROM.EXE.c @@ -1,4 +1,4 @@ -/* This file was generated by the Hex-Rays decompiler version 8.3.0.230608. +/* This file was generated by the Hex-Rays decompiler version 9.0.0.240807. Copyright (c) 2007-2021 Hex-Rays Detected compiler: Visual C++ @@ -5312,7 +5312,7 @@ void __thiscall cMissionLoopClient::cMissionLoopClient(cMissionLoopClient *this) void __thiscall cCreatureStore::~cCreatureStore(cCreatureStore *this); // idb void __cdecl j__ObjPosUpdateUnsafe(int obj, const mxs_vector *pos, const mxs_angvec *ang); // idb void __thiscall cPhysModels::~cPhysModels(cPhysModels *this); // idb -int __cdecl PlayEnd(multiped *m, int motion_number, int frame, float time_slop, unsigned int flags); // idb +int __cdecl PlayEnd(multiped *m, int motion_number, int frame, float time_slop, char flags); // idb void __thiscall cSpecificProperty>::cSpecificProperty>(cSpecificProperty > *this, const sPropertyDesc *desc); // idb void __thiscall cSpecificProperty>::~cSpecificProperty>(cSpecificProperty > *this); // idb void __thiscall cBasePropEditTrait::cBasePropEditTrait(cBasePropEditTrait *this, IProperty *prop); // idb @@ -5825,7 +5825,7 @@ void __thiscall cNetManager::cNetManager(cNetManager *this, IUnknown *pOuter); / void __cdecl j__GhostAttachWeapon(sGhostRemote *pCreat, int nWeapon); // idb void __cdecl j__SetPlayerMode(ePlayerMode mode); // idb int j__dark_term_object_rend(); -void __cdecl cQuestData::ObjListener(int objID, unsigned int msg, void *data); // idb +void __cdecl cQuestData::ObjListener(int objID, unsigned int msg); // idb void __cdecl j__portal_set_normalized_color(int rm, int gm, int bm); // idb void __thiscall cAutoLinkQuery::cAutoLinkQuery(cAutoLinkQuery *this, IRelation *pRel, int src, int dst); // idb void __thiscall cClassDataOps::cClassDataOps(cClassDataOps *this, cClassDataOps::eFlags flags); // idb @@ -6061,7 +6061,7 @@ int __cdecl j___GhostGravRemote(int obj, sGhostPos *pPos, int cfg_flags); // idb void __thiscall cSpecificProperty>::~cSpecificProperty>(cSpecificProperty > *this); // idb cWinMenu *__thiscall cMenuSet::GetMenuByNumber(cMenuSet *this, int number); // idb void __cdecl metaSndLoadGUINames(char *prefix); // idb -int __cdecl PropTraitPred(int obj, void *data); // idb +int __cdecl PropTraitPred(int obj, cStoredProperty *data); // idb void __thiscall cHashIter>::cHashIter>(cHashIter > *this); // idb int j__ReportTerm(void); // weak void __thiscall cSpecificProperty>::~cSpecificProperty>(cSpecificProperty > *this); // idb @@ -9534,7 +9534,7 @@ unsigned int __cdecl j__dbMergeLoad(const char *filename, unsigned int loadtype) void __thiscall cHashIter>::cHashIter>(cHashIter > *this, const cHashTable > *t); // idb void __thiscall cLinkArrayLinkStore::cOuterPointer::Init(cLinkArrayLinkStore::cOuterPointer *this, IUnknown *p); // idb int __cdecl j__NamenumFetchTagForString(_namenum *ss, char *name); // idb -unsigned __int8 __cdecl j__bugterm_textbox_cb(_LGadTextBox *box, int event, int evdata, void *data); // idb +unsigned __int8 __cdecl j__bugterm_textbox_cb(_LGadTextBox *box, int event, int evdata); // idb void __thiscall cPhysStateOps::~cPhysStateOps(cPhysStateOps *this); // idb int __thiscall cHashTable>::Lookup(cHashTable > *this, const unsigned int *k, int *v); // idb void __cdecl PhysCheckForWarnings(int objID, char *buffer); // idb @@ -9672,7 +9672,7 @@ int __cdecl j__SongYaccParse(char *songFile, ISong **ppSong); // idb void __thiscall cAutoIPtr::cAutoIPtr(cAutoIPtr *this, const _GUID *id, IUnknown *pUnknownFrom); // idb void __thiscall cArrayPropObjIDSink>::~cArrayPropObjIDSink>(cArrayPropObjIDSink > *this); // idb IStringProperty *__cdecl j__CreateGameNameProperty(); // idb -unsigned __int8 __cdecl cOptions::OnBindButton(unsigned __int16 action, int button, void *data, _LGadBox *__formal); // idb +unsigned __int8 __cdecl cOptions::OnBindButton(unsigned __int16 action, int button, cOptions *data); // idb void __thiscall cDynArray_::cDynArray_(cDynArray_ *this); // idb cTagRecord **__thiscall cDABase>::operator[](cDABase > *this, int index); // idb void __cdecl cDARawSrvFns::PreSetSize(IRelation **__formal, unsigned int __formal, unsigned int __formal); // idb @@ -9726,7 +9726,7 @@ void __thiscall cAIConverseGoal::cAIConverseGoal(cAIConverseGoal *this, IAIAbili void __thiscall cDynArray::cDynArray(cDynArray *this); // idb void __cdecl j__set_up_temp_lightmap(st_PortalLightMap *map); // idb void __cdecl PhysBinPrintFunc(void *bin, char *str, int maxstrlen); // idb -unsigned __int8 __cdecl cNewGame::DiffCB(unsigned __int16 action, int button, void *data, _LGadBox *__formal); // idb +unsigned __int8 __cdecl cNewGame::DiffCB(unsigned __int16 action, int button); // idb void __thiscall cSparseHashPropertyStore::~cSparseHashPropertyStore(cSparseHashPropertyStore *this); // idb void __cdecl readFunc(char *); // idb IScriptMan *__thiscall cLazyAggMember::operator->(cLazyAggMember *this); // idb @@ -9901,7 +9901,7 @@ void __cdecl cAIJointScanAction::HandleNetMessage(IAI *pAI, void *pMsg); // idb void __thiscall cAIRandomTimer::Force(cAIRandomTimer *this); // idb void __thiscall cAICombatNewRanged::~cAICombatNewRanged(cAICombatNewRanged *this); // idb void __cdecl j__EditLinks(const sLinkEditorDesc *desc, int src, int dest, __int16 flav); // idb -void __cdecl cOptions::PlayRightTest(int __formal, void *__formal); // idb +void __cdecl cOptions::PlayRightTest(); // idb int __cdecl IsACD(char *path); // idb cMpsMotion *__thiscall cDABase>::operator[](cDABase > *this, int index); // idb void __thiscall cRooms::RemoveTransitionCallback(cRooms *this, void (__cdecl *callback)(int, cRoom *, cRoom *)); // idb @@ -10920,7 +10920,7 @@ void __thiscall cOptions::OnSubPanelButtonList(cOptions *this, unsigned __int16 void __cdecl AIPathFindWrite(ITagFile *pTagFile); // idb void __thiscall cAIDefend::cAIDefend(cAIDefend *this); // idb int __cdecl processTweqJoints(int, void *, int); // idb -unsigned __int8 __cdecl j__cmdterm_textbox_cb(_LGadTextBox *box, int event, int evdata, void *data); // idb +unsigned __int8 __cdecl j__cmdterm_textbox_cb(_LGadTextBox *box, int event, int evdata); // idb void __thiscall cListPropertyStore::cListPropertyStore(cListPropertyStore *this); // idb void __thiscall cGenericProperty::~cGenericProperty(cGenericProperty *this); // idb int __cdecl j__IncludeFileOpen(char *string, int push); // idb @@ -15046,7 +15046,7 @@ void __thiscall cProperty::cPropertyStore(cPropertyStore *this); // idb void __thiscall cDynArray_::~cDynArray_(cDynArray_ *this); // idb -LSTATUS j__StopVoiceChat(); +UINT j__StopVoiceChat(); void __thiscall cAvatar::cRefCount::cRefCount(cAvatar::cRefCount *this); // idb void __thiscall cCTUnaggregated::cCTUnaggregated(cCTUnaggregated *this); // idb cAIOrientAction *__thiscall cAIActorBase::CreateOrientAction(cAIActorBase *this, unsigned int data); // idb @@ -15502,12 +15502,12 @@ void __thiscall cDABase void __thiscall sScrMsg::sScrMsg(sScrMsg *this); // idb void __thiscall cPlayerCerebellum::SetupMode(cPlayerCerebellum *this, int mode); // idb unsigned int __cdecl Rand250(); -void __cdecl Rand250Seed(int seed); // idb +void __cdecl Rand250Seed(unsigned int seed); void __cdecl AppRandInit(); // idb int __cdecl Rand(); // idb int __cdecl RandRange(int low, int high); // idb int __cdecl UnrecordedRand(); // idb -void *__cdecl dark_gr_malloc(int n); // idb +void *__cdecl dark_gr_malloc(unsigned int n); void __cdecl dark_gr_free(void *p); // idb int __stdcall Gr2dInitFunc(IUnknown *goof); // idb int __stdcall Gr2dShutdownFunc(IUnknown *goof); // idb @@ -15807,7 +15807,7 @@ int __cdecl SFX_GetNumChannels(); // idb void __cdecl SFX_SetReverseStereo(int state); // idb int __cdecl SFX_StereoReversed(); // idb void __cdecl SFX_Slam_Dist(int hnd, int distance, int force_update); // idb -void __cdecl SFX_Slam_Dist_BF(int hnd, int distance, float blocking_factor, int force_update); // idb +void __cdecl SFX_Slam_Dist_BF(int hnd, int distance, int blocking_factor, int force_update); void __cdecl SFX_SetMode(sfx_mode mode); // idb void FinishAsynchOps(); void __cdecl SFX_KillAll(sfx_mode mode); // idb @@ -15854,7 +15854,7 @@ void __cdecl cDARawSrvFns<_sfx>::ConstructItem(_sfx *pItem, const _sfx *pFrom); int __thiscall cDABase<_sfx,4,cDARawSrvFns<_sfx>>::Resize(cDABase<_sfx,4,cDARawSrvFns<_sfx> > *this, unsigned int newSlotCount); // idb ISndSample *__cdecl CreateMemSoundSource(ISndMixer *pMixer, void *pBuffer, unsigned int bufferLen, void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData); // idb void __cdecl endFakeSplicer(ISndSample *pSample, _DWORD *pCBData); -ISndSample *__cdecl CreateMemSoundSourceLooped(ISndMixer *pMixer, void *pBuffer, unsigned int bufferLen, void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData, ISndSource **ppSndSrc, int nLoops, void (__cdecl *loopCB)(ISndSource *, unsigned int *), void *pLoopCBData); // idb +ISndSample *__cdecl CreateMemSoundSourceLooped(ISndMixer *pMixer, void *pBuffer, unsigned int bufferLen, void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData, ISndSource **ppSndSrc, unsigned int nLoops, void (__cdecl *loopCB)(ISndSource *, unsigned int *), void *pLoopCBData); ISndSample *__cdecl CreateNRezStreamedSoundSource(ISndMixer *pMixer, IRes *pRez, char **ppStreamBuffer, void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData, ISndSource **ppSndSrc); // idb ISndSample *__cdecl CreateSongSoundSource(ISndMixer *pMixer, unsigned int numSegments, IRes **pResArray, char **ppStreamBuffer, void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData, ISndSource **ppSndSrc, void (__cdecl *segmentCB)(ISndSource *, unsigned int *), void *pSegmentCBData); // idb int BackupMission(); @@ -15879,8 +15879,8 @@ void __cdecl movefunc(char *buf, unsigned int elsize, unsigned int nelem); BOOL __cdecl setup_tagfile(ITagFile *file, _TagFileTag *tag, VersionNum *version); void __cdecl cleanup_tagfile(ITagFile *file); // idb VFILE *__cdecl vfopen(const char *file, const char *mode); // idb -unsigned int __cdecl vfread(void *pTo, unsigned int s, unsigned int n, VFILE *pVFile); // idb -size_t __cdecl vfwrite(const void *pFrom, unsigned int s, unsigned int n, VFILE *pVFile); +size_t __cdecl vfread(void *pTo, size_t s, size_t n, VFILE *pVFile); +size_t __cdecl vfwrite(const void *pFrom, size_t s, size_t n, VFILE *pVFile); int __cdecl vfseek(VFILE *pVFile, int offset, int type); // idb int __cdecl vftell(VFILE *pVFile); // idb int __cdecl vfclose(VFILE *pVFile); // idb @@ -15898,7 +15898,7 @@ int __stdcall BufTagFileBase::BlockSize(BufTagFileBase *this, const _TagFileTag BufTagTableEntry *__stdcall BufTagFileBase::CurrentBlock(BufTagFileBase *this); void __thiscall BufTagFileBase::SetCurBlock(BufTagFileBase *this, const _TagFileTag *tag); // idb unsigned int __thiscall BufTagFileBase::PrepSeek(BufTagFileBase *this, unsigned int *offset, TagFileSeekMode mode); -int __stdcall BufTagFileBase::Seek(BufTagFileBase *this, int offset, TagFileSeekMode mode); +int __stdcall BufTagFileBase::Seek(BufTagFileBase *this, unsigned int offset, TagFileSeekMode mode); // idb unsigned int __stdcall BufTagFileBase::Tell(BufTagFileBase *this); // idb unsigned int __stdcall BufTagFileBase::TellFromEnd(BufTagFileBase *this); // idb int __stdcall cBufTagIter::QueryInterface(cBufTagIter *this, const _GUID *id, void **ppI); // idb @@ -15911,7 +15911,7 @@ void __thiscall BufTagFileWrite::~BufTagFileWrite(BufTagFileWrite *this); // idb int __stdcall BufTagFileWrite::OpenBlock(BufTagFileWrite *this, const _TagFileTag *tag, VersionNum *version); // idb int __stdcall BufTagFileWrite::CloseBlock(BufTagFileWrite *this); // idb int __stdcall BufTagFileWrite::Read(BufTagFileWrite *this, char *__formal, int a3); // idb -int __stdcall BufTagFileWrite::Write(BufTagFileWrite *this, const char *buf, int buflen); // idb +int __stdcall BufTagFileWrite::Write(BufTagFileWrite *this, const char *buf, unsigned int buflen); int __stdcall BufTagFileWrite::Move(BufTagFileWrite *this, char *buf, int len); // idb TagFileOpenMode __stdcall BufTagFileRead::OpenMode(BufTagFileRead *this); // idb void __thiscall BufTagFileRead::BufTagFileRead(BufTagFileRead *this, const char *filename); // idb @@ -15955,7 +15955,7 @@ BufTagFileRead *__thiscall BufTagFileRead::`scalar deleting destructor'(BufTagFi void __thiscall cHashSet::cHashSet(cHashSet *this, unsigned int n); // idb cHashSet *__thiscall cHashSet::`scalar deleting destructor'(cHashSet *this, char __flags); tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, BufTagTableEntry *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, _TagFileTag *key); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const _TagFileTag *key); tHashSetNode__ *__thiscall cHashSetBase::Search(cHashSetBase *this, tHashSetKey__ *a); // idb tHashSetHandle *__thiscall cHashSetBase::FindIndex(cHashSetBase *this, tHashSetHandle *result, tHashSetKey__ *__$ReturnUdt); // idb void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb @@ -15963,7 +15963,7 @@ tHashSetNode__ *__thiscall cHashSet::GetNext(cHashSet *this, tHashSetHandle *Handle); tHashSetNode__ *__thiscall cHashSetBase::GetNext(cHashSetBase *this, tHashSetHandle *h); // idb -int __thiscall cHashSet::IsEqual(cHashSet *this, _TagFileTag *k1, _TagFileTag *k2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb int __cdecl BufTagHashFunctions::Hash(const _TagFileTag *p); _iobuf *__cdecl FindFreeFile(char *buff, char *prefix, char *suffix); // idb @@ -16020,7 +16020,7 @@ void __cdecl CameraSetAngOffset(Camera *cam, mxs_angvec *ang); // idb void __cdecl CameraGetAngOffset(Camera *cam, mxs_angvec *ang); // idb void __cdecl CameraUpdate(Camera *cam); // idb void __cdecl CameraNextMode(Camera *cam); // idb -void __cdecl CameraSetMode(Camera *cam, int mode); // idb +void __cdecl CameraSetMode(Camera *cam, eCameraMode mode); eCameraMode __cdecl CameraGetMode(Camera *cam); int __cdecl CameraGetObjID(Camera *cam); // idb void __cdecl CameraSave(Camera *cam, char *str); // idb @@ -16084,8 +16084,8 @@ void __thiscall cSimpleDListIter::sElem>::Next(cSimpleD void __thiscall cSimpleDListIter::sElem>::cSimpleDListIter::sElem>(cSimpleDListIter::sElem> *this, cSimpleDListNode::sElem> *node); // idb void __thiscall cDList::sElem>,1>::DestroyAll(cDList::sElem>,1> *this); // idb cSimpleDListNode::sElem> *__thiscall cDList::sElem>,1>::GetFirst(cDList::sElem>,1> *this); // idb -int __thiscall cSimpleListSet::sElem>::AddElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); -int __thiscall cSimpleListSet::sElem>::RemoveElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); +int __thiscall cSimpleListSet::sElem>::AddElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); // idb +int __thiscall cSimpleListSet::sElem>::RemoveElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); // idb cSimpleDListNode::sElem> *__thiscall cDListNode::sElem>,1>::GetNext(cDListNode::sElem>,1> *this); // idb int __thiscall cDispatch::sElem::operator==(cDispatch::sElem *this, const cDispatch::sElem *e); // idb void __thiscall cSimpleDList::sElem>::Prepend(cSimpleDList::sElem> *this, const cDispatch::sElem *e); // idb @@ -16134,7 +16134,7 @@ void __cdecl process_config_scripts(const char *prefix); // idb unsigned __int8 __cdecl script_iter(char *var); // idb int __cdecl find_file_in_config_path(char *targ, char *filename, char *path_var); // idb void __cdecl CommandRegister(Command *cmd_set, int count, unsigned int contexts); // idb -Command *__cdecl CommandFind(char *s, int n); // idb +Command *__cdecl CommandFind(char *s, size_t n); Command *__cdecl CommandFindString(char *s); // idb unsigned __int8 __cdecl CommandParse(char *inp, Command **res_1, char **res_2); // idb char *__cdecl CommandExecute(char *inp); // idb @@ -16317,7 +16317,7 @@ void __cdecl cDARawSrvFns::ConstructItem(cTagRecord **pItem, cTagR cAnsiStr *__thiscall cAnsiStr::`scalar deleting destructor'(cAnsiStr *this, char __flags); int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb -void __thiscall cTagSet::Append(cTagSet *this, cTagSet *Source); +void __thiscall cTagSet::Append(cTagSet *this, cTagSet *Source); // idb int __thiscall cTagSet::Remove(cTagSet *this, const cTag *Tag); // idb void __thiscall cTagSet::ToString(cTagSet *this, cAnsiStr *pDest); // idb int __thiscall cTagSet::FromString(cTagSet *this, const char *pszString); // idb @@ -16362,7 +16362,7 @@ void __thiscall cIPtr::cIPtr(cIPtr *this, IUnknown *pUnknow void __cdecl reset_objid_space(); // idb BOOL __cdecl dbFind(char *filename, char *fullname); BOOL __cdecl find_for_load(char *fullname, char *filename); -void __cdecl dbCurrentFile(char *buf, int len); // idb +void __cdecl dbCurrentFile(char *buf, size_t len); void __cdecl dbSetCurrentFile(char *buf); // idb const char *__cdecl strip_pathname(const char *filename); // idb int __cdecl ReadMissionHeader(ITagFile *file, char *mapName, char *gamName); // idb @@ -16379,8 +16379,8 @@ unsigned int __cdecl dbMergeLoad(char *filename, unsigned int loadtype); unsigned int __cdecl dbLoadTagFile(ITagFile *file, unsigned int loadtype); // idb unsigned int __cdecl dbMergeLoadTagFile(ITagFile *file, unsigned int loadtype); // idb void __cdecl set_gamesys_file(char *fn); // idb -int __cdecl read_file_type(ITagFile *file, unsigned int *Filetype); // idb -int __cdecl read_file_ref_tag(ITagFile *file, unsigned int ftype, char *filename); // idb +BOOL __cdecl read_file_type(ITagFile *file, unsigned int *Filetype); +BOOL __cdecl read_file_ref_tag(ITagFile *file, unsigned int ftype, char *filename); __int16 dbReset(); void dbBuildDefault(); int __cdecl dbCurrentFilenum(); // idb @@ -16417,8 +16417,8 @@ int __cdecl CheckForDiskspaceAndMessage(char *str, int minMB); // idb void DispatchInit(); void UpdateBaseMode(); unsigned int DispatchShutdown(); -void __cdecl DispatchMsg(int kind, DispatchData *data); -void __cdecl DispatchMsgAllClients(int kind, DispatchData *data, int flags); +void __cdecl DispatchMsg(unsigned int kind, DispatchData *data); // idb +void __cdecl DispatchMsgAllClients(unsigned int kind, DispatchData *data, int flags); // idb BOOL __cdecl DispatchInMsg(unsigned int mask); int __cdecl DispatchCurrentMsg(unsigned int *kind, DispatchData **data); // idb int __thiscall cAutoIPtr::operator=(cAutoIPtr *this, int __formal); // idb @@ -16512,7 +16512,7 @@ int __cdecl ObjGetWeaponType(int obj, int *type); // idb void __cdecl ObjSetWeaponType(int obj, int type); // idb void __cdecl ObjUnsetWeaponType(int obj); // idb eSlayResult __cdecl ObjGetSlayResult(int obj); // idb -void __cdecl ObjSetSlayResult(int obj, int result); +void __cdecl ObjSetSlayResult(int obj, eSlayResult result); // idb void init_slay_sdesc(); void __thiscall InitDamageReactions(IUnknown *this); unsigned int __cdecl create_damage(IReactions *pReactions); // idb @@ -16531,7 +16531,7 @@ void DxWarnDlg(); int CellRefInit(); void **__cdecl CellRefListFunc(_DWORD *bin); void __cdecl CellRefListClearFunc(_DWORD *bin); -void __cdecl CellBinUpdateFunc(int obj, int refsys, _DWORD *binmem, int num_bins); +void __cdecl CellBinUpdateFunc(int obj, unsigned int refsys, _DWORD *binmem, int num_bins); void __cdecl CellBinPrintFunc(_DWORD *bin, char *str, int maxstrlen); int __cdecl CellBinComputeFunc(int obj, BoundingPrism *bound, int *bins); int __cdecl CellRefRegister(); // idb @@ -16671,7 +16671,7 @@ int __cdecl ESndPlay(cTagSet *pTagSet, int Obj1, int Obj2, sSchemaCallParams *pP int __cdecl ESndPlayCore(cTagSet *pTagSet, int Obj1, int Obj2, void *pData, sSchemaCallParams *pCallParams); // idb void __cdecl DumpTagSet(cTagSet *pTagSet); // idb int __cdecl ESndPlayObj(cTagSet *pTagSet, int Obj1, int Obj2, sSchemaCallParams *pParams, void *pData); // idb -int __cdecl ESndPlayLoc(cTagSet *pTagSet, int Obj1, int Obj2, mxs_vector *pLoc, sSchemaCallParams *pParams, void *pData); +int __cdecl ESndPlayLoc(cTagSet *pTagSet, int Obj1, int Obj2, mxs_vector *pLoc, sSchemaCallParams *pParams, void *pData); // idb int ESndInit(); ITagDBDatabase *ESndTerm(); int ESndDump(); @@ -16692,7 +16692,7 @@ void __thiscall cDynArray_::~cDynArray_(cDynAr void __thiscall sTagDBData::sTagDBData(sTagDBData *this); // idb unsigned int __thiscall cPackedBoolSet::IsSet(cPackedBoolSet *this, int i); void __thiscall cTagSet::cTagSet(cTagSet *this, const cTagSet *Source); // idb -void __thiscall cTagDBInput::AppendTagSet(cTagDBInput *this, cTagSet *pTagSet, int iFlags, float fWeight); +void __thiscall cTagDBInput::AppendTagSet(cTagDBInput *this, cTagSet *pTagSet, int iFlags, float fWeight); // idb const cTag *__thiscall cTagSet::GetEntry(cTagSet *this, int iIndex); // idb void __thiscall cTagDBInputTag::cTagDBInputTag(cTagDBInputTag *this, cTag *Tag, int iFlags, float fWeight); // idb void __thiscall cTagDBOutput::Clear(cTagDBOutput *this); // idb @@ -16734,7 +16734,7 @@ void __thiscall cDABase>::cDABase>::~cDABase>(cDABase > *this); // idb sTagDBData *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); int __thiscall cDABase>::SetSize(cDABase > *this, unsigned int newSize); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb unsigned __int8 *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); int __thiscall cDABase>::SetSize(cDABase > *this, unsigned int newSize); // idb @@ -16750,7 +16750,7 @@ int __thiscall cDABase>::Resize(cD int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb unsigned int __cdecl cHashTableFunctions::Hash(const int *k); // idb -unsigned int __cdecl cHashFunctions::Hash(unsigned int p); +unsigned int __cdecl cHashFunctions::Hash(int p); int __cdecl cHashTableFunctions::IsEqual(const int *k1, const int *k2); // idb BOOL __cdecl cHashFunctions::IsEqual(int p1, int p2); int __cdecl ObjGetESndClass(int obj, sESndTagList **pData); // idb @@ -16887,7 +16887,7 @@ void __cdecl NormBuffFromRes8(_sSndAttribs *pAttribs, unsigned __int8 *pRawData, void __cdecl NormBuffFromRes16(_sSndAttribs *pAttribs, __int16 *pRawData, float *pfSamples); double __cdecl Average(float *pfSamples, unsigned int nCount); double __cdecl StandardDeviation(float *pfSamples, unsigned int nCount, float fAverage); -char __cdecl FindFacePos(float *pfSamples, int iNum, float fStDev); // idb +char __cdecl FindFacePos(float *pfSamples, unsigned int iNum, float fStDev); int __cdecl FaceSetVisage(int Obj, eFaceVisage Visage, unsigned int nPriority, int iDuration); // idb void __cdecl FaceInit(); // idb void __cdecl SpeechStartCB(int speakerID, int hSchema); @@ -17096,7 +17096,7 @@ int fam_palette_free(); fam_record *__cdecl _fam_lookup_record(char *str); // idb BOOL __cdecl family_remove(char *str, int synch); int __cdecl family_add(char *str); // idb -int __cdecl fam_palette_check(char *dir); // idb +BOOL __cdecl fam_palette_check(char *dir); fam_record *__cdecl fam_get_free_record(); // idb int __cdecl family_load_water(char *water_prefix); // idb int __cdecl family_add_water(const char *prefix); // idb @@ -17104,7 +17104,7 @@ void family_reload_water(); void __cdecl reload_single_water(int i); // idb BOOL __cdecl get_sky_palette(char *path_base, char *sky_name); int __cdecl family_texture_is_water(int i); // idb -int __cdecl family_find_water(const char *prefix, int *handles); +BOOL __cdecl family_find_water(const char *prefix, int *handles); int __cdecl find_single(char *base, char *name); void __cdecl family_cmd_add_water(char *water_prefix); // idb void __cdecl family_cmd_free_water(char *water_prefix); // idb @@ -17132,10 +17132,10 @@ int family_clear_all(); unsigned int __cdecl FrameAnimationGetFrame(FrameAnimationState *state, FrameAnimationConfig *cfg, int num_frames); BOOL __cdecl FrameAnimationIsDone(FrameAnimationState *state); void __cdecl FrameAnimationStateStart(FrameAnimationState *fas); // idb -void __cdecl FrameAnimationStateBackdateSetFrame(FrameAnimationState *fas, FrameAnimationConfig *cfg, int frame, unsigned int tm); // idb +void __cdecl FrameAnimationStateBackdateSetFrame(FrameAnimationState *fas, FrameAnimationConfig *cfg, unsigned int frame, unsigned int tm); void __cdecl FrameAnimationStateBackdateStart(FrameAnimationState *fas, FrameAnimationConfig *cfg, unsigned int tm); // idb void __cdecl FrameAnimationStateSetFrame(FrameAnimationState *fas, FrameAnimationConfig *cfg, int cur_frame); // idb -void __cdecl FrameAnimationChange(FrameAnimationState *state, FrameAnimationConfig *old_cfg, int old_frames, FrameAnimationConfig *new_cfg, int new_frames); // idb +void __cdecl FrameAnimationChange(FrameAnimationState *state, FrameAnimationConfig *old_cfg, int old_frames, FrameAnimationConfig *new_cfg, unsigned int new_frames); int __cdecl FASPropInit(); // idb unsigned int FASPropShutdown(); FrameAnimationState *__cdecl ObjGetFrameAnimationState(int obj); // idb @@ -17331,7 +17331,7 @@ void __thiscall cFrameAnimationStateProperty::`vector deleting destructor'(void void __thiscall cProperty::`vector deleting destructor'(void *this); void __thiscall cFancyTagDatabase::cFancyTagDatabase(cFancyTagDatabase *this, int nCategories); // idb void __thiscall cFancyTagDatabase::~cFancyTagDatabase(cFancyTagDatabase *this); // idb -void __thiscall cFancyTagDatabase::InsertData(cFancyTagDatabase *this, int category, ITagDBKeySet *pSet, sTagDBData Data); +void __thiscall cFancyTagDatabase::InsertData(cFancyTagDatabase *this, int category, ITagDBKeySet *pSet, const sTagDBData Data); // idb unsigned int __thiscall cFancyTagDatabase::RegisterTag(cFancyTagDatabase *this, const sTagInfo *pTagInfo); // idb const sTagInfo *__thiscall cFancyTagDatabase::GetTagInfo(cFancyTagDatabase *this, unsigned int handle); // idb int __thiscall cFancyTagDatabase::Load(cFancyTagDatabase *this, ITagFile *pFile); // idb @@ -17369,8 +17369,8 @@ char *__cdecl attachPostfix(char *targ, char *base, const char *post); // idb unsigned __int8 __cdecl CopyOpenFile(const char *name, int src_hnd); // idb unsigned __int8 __cdecl CopyFileNamed(const char *targ, const char *src); // idb BOOL __cdecl is_full_path(const char *fn); -char *__cdecl FileDialog(eFileMenuMode mode, sFileMenuFilter *pFilters, const char *def_ext, char *buffer, int buflen); // idb -LRESULT __stdcall FileMenuWndProc(HWND__ *hWnd, unsigned int msg, unsigned int wParam, int lParam); +char *__cdecl FileDialog(eFileMenuMode mode, sFileMenuFilter *pFilters, const char *def_ext, char *buffer, unsigned int buflen); +LRESULT __stdcall FileMenuWndProc(HWND__ *hWnd, UINT msg, WPARAM wParam, LPARAM lParam); void FileMenu(); const cAnsiStr *__thiscall cAnsiStr::operator+=(cAnsiStr *this, char *psz); const cAnsiStr *__thiscall cAnsiStr::operator+=(cAnsiStr *this, char ch); // idb @@ -18118,7 +18118,7 @@ int _E6_2(); void _E2_1(); int _E5_1(); void __cdecl _E3_0(); // idb -IStructEditor *__cdecl CreateStructEditor(sStructEditorDesc *eddesc, sStructDesc *sdesc, void *editme); +IStructEditor *__cdecl CreateStructEditor(const sStructEditorDesc *eddesc, const sStructDesc *sdesc, void *editme); // idb void __thiscall cDynFunc::cDynFunc(cDynFunc *this, const char *pszLibName, const char *pszFuncSig, void *pfnFail); // idb void __thiscall __cDynFunc__ConstructStructEditor::~__cDynFunc__ConstructStructEditor(__cDynFunc__ConstructStructEditor *this); // idb void __thiscall cDynFunc::~cDynFunc(cDynFunc *this); // idb @@ -18128,10 +18128,10 @@ void *__thiscall cDynFunc::GetFunc(cDynFunc *this); // idb void _E2_2(); void _E1_1(); void __thiscall cDarkJoyProcControl::cDarkJoyProcControl(cDarkJoyProcControl *this); // idb -void __cdecl UiJoyAxisConfigure(int axis, int *pRange, int *pMid, int deadZone); // idb +void __cdecl UiJoyAxisConfigure(int axis, int *pRange, int *pMid, unsigned int deadZone); int UiJoyInit(); -void __cdecl DispatchJoystickMoveEvent(unsigned __int8 joyNum, __int16 x, __int16 y); -void __cdecl DispatchJoystickButtonEvent(unsigned __int8 buttNum, char state); +void __cdecl DispatchJoystickMoveEvent(char joyNum, __int16 x, __int16 y); +void __cdecl DispatchJoystickButtonEvent(char buttNum, char state); // idb int uiJoystickPoller(); void uiSetControlCenter(); void __thiscall cIBJoyAxisProcess::SetDeadZoneX(cIBJoyAxisProcess *this, long double x); // idb @@ -18733,7 +18733,7 @@ void __cdecl ParseMenu(const char *pszMenuText, const char *pszMenuTag, cMenuSet int __cdecl CreateMenu(const char *pszMenuTag); // idb void __cdecl SetMainMenu(const char *pszName); // idb void __cdecl MenuCommand(unsigned int id); // idb -void __cdecl SetRadioCheckmark(int menu, int firstPos, int lastPos, int checkPos); // idb +void __cdecl SetRadioCheckmark(int menu, unsigned int firstPos, unsigned int lastPos, unsigned int checkPos); cWinMenu *__thiscall cWinMenu::`scalar deleting destructor'(cWinMenu *this, char __flags); void __thiscall cMenuCommands::~cMenuCommands(cMenuCommands *this); // idb void __thiscall cDynArray::~cDynArray(cDynArray *this); // idb @@ -18752,14 +18752,14 @@ void __thiscall cAnsiStr::Mid(cAnsiStr *this, cAnsiStr *s1, int nFirst, int nCou unsigned int __thiscall cMenuCommands::NewCommand(cMenuCommands *this, const char *pszCommand); // idb void __thiscall cMenuSet::BeginMenu(cMenuSet *this, const char *pszSubMenuName); // idb BOOL __thiscall cWinMenu::CreateMenu(cWinMenu *this); -BOOL __thiscall cWinMenu::AppendMenuA(cWinMenu *this, unsigned int nFlags, unsigned int nIDNewItem, const char *pszNewItem); +BOOL __thiscall cWinMenu::AppendMenuA(cWinMenu *this, UINT nFlags, UINT_PTR nIDNewItem, const char *pszNewItem); void __thiscall cMenuSet::EndMenu(cMenuSet *this); // idb void __thiscall cMenuSet::AddItem(cMenuSet *this, const char *pszMenuItemName, unsigned int id); // idb void __thiscall cMenuSet::AddSeparator(cMenuSet *this); // idb void __thiscall cStrHashTable::~cStrHashTable(cStrHashTable *this); // idb cStrHashTable *__thiscall cStrHashTable::`vector deleting destructor'(cStrHashTable *this, char __flags); const char *__thiscall cMenuCommands::Lookup(cMenuCommands *this, unsigned int id); // idb -BOOL __thiscall cWinMenu::CheckMenuRadioItem(cWinMenu *this, unsigned int nIDFirst, unsigned int nIDLast, unsigned int nIDItem, unsigned int nFlags); +BOOL __thiscall cWinMenu::CheckMenuRadioItem(cWinMenu *this, UINT nIDFirst, UINT nIDLast, UINT nIDItem, UINT nFlags); void __thiscall cDynArray::cDynArray(cDynArray *this); // idb void __thiscall cDynArray::cDynArray(cDynArray *this); // idb int __thiscall cHashTable>::Lookup(cHashTable > *this, const char *const *k, int *v); // idb @@ -19620,12 +19620,12 @@ void __cdecl compute_ltab816_rgb(unsigned __int16 *table, unsigned __int8 *pal_d void __cdecl palmgr_set_pal_slot_passively(int start, int n, unsigned __int8 *pal, unsigned int slot); void __cdecl palmgr_set_pal_slot(int start, int n, unsigned __int8 *pal, int slot); // idb int __cdecl palmgr_alloc_pal(unsigned __int8 *pal); // idb -void __cdecl palmgr_release_slot(int slot); // idb +void __cdecl palmgr_release_slot(unsigned int slot); int __cdecl palmgr_verify_slot(unsigned int slot, char *func); -void __cdecl palmgr_add_ref_slot(int slot); // idb -void __cdecl palmgr_free_ipal(int slot); // idb -unsigned __int8 *__cdecl palmgr_get_ipal(int slot); // idb -unsigned __int8 *__cdecl palmgr_get_pal(int slot); // idb +void __cdecl palmgr_add_ref_slot(unsigned int slot); +void __cdecl palmgr_free_ipal(unsigned int slot); +unsigned __int8 *__cdecl palmgr_get_ipal(unsigned int slot); +unsigned __int8 *__cdecl palmgr_get_pal(unsigned int slot); void __thiscall palmgr_recompute_all(void *this); int __cdecl palmgr_get_current_count(int mono_print); // idb unsigned __int8 __cdecl cPanelLoopClient::PanelEventHandler(_ui_event *ev, _Region *reg, _DWORD **data); @@ -19704,7 +19704,7 @@ int __cdecl RandRangeFix(int x0, int x1); // idb int __cdecl MyRand(); // idb double __cdecl MyRandRange(int x0, int x1); void __cdecl determine_launch_loc(st_ParticleGroup *pg, mxs_vector *launch_pt); // idb -void __cdecl update_particles(st_ParticleGroup *pg, int index, int num, int time); // idb +void __cdecl update_particles(st_ParticleGroup *pg, unsigned int index, int num, int time); void __cdecl delete_particle(st_ParticleGroup *pg, unsigned int index); void __cdecl compute_current_minmax(st_ParticleGroup *pg); // idb int free_shared_lists(); @@ -19735,7 +19735,7 @@ void __cdecl pgroup_basic_sim(st_ParticleGroup *pg, float simtime); // idb void __cdecl pgroup_velocity_sim(st_ParticleGroup *pg, float simtime); // idb void __cdecl pgroup_attached_sim(st_ParticleGroup *pg, float simtime); // idb void __cdecl pgroup_trailing_sim(st_ParticleGroup *pg, float simtime); // idb -int __cdecl particle_launch_sim(st_ParticleGroup *pg, float time); // idb +BOOL __cdecl particle_launch_sim(st_ParticleGroup *pg, float time); void __cdecl do_launching(st_ParticleGroup *pg, int time); // idb void __cdecl compute_launch_minmax(st_ParticleGroup *pg); // idb void __cdecl allocate_lists(st_ParticleGroup *pg, int n); // idb @@ -20041,7 +20041,7 @@ int showObjsTracked(); void showNetTimes(); void __cdecl CheatCheckToggleBool(unsigned __int8 *var, char *cmd, char *name); // idb void __cdecl EnableCheats(int val); // idb -int __cdecl ComputeCheatCode(); // idb +size_t __cdecl ComputeCheatCode(); BOOL toggle_show_stats(); int PlaytestInitReal(); int PlaytestTermReal(); @@ -20216,7 +20216,7 @@ void __thiscall cPlayerMode::cPlayerMode(cPlayerMode *this); // idb void __thiscall cPlayerMode::~cPlayerMode(cPlayerMode *this); // idb void __thiscall cPlayerMode::Read(cPlayerMode *this, ITagFile *file); // idb void __thiscall cPlayerMode::Write(cPlayerMode *this, ITagFile *file); // idb -void __thiscall cPlayerMode::SetMode(cPlayerMode *this, unsigned int mode); +void __thiscall cPlayerMode::SetMode(cPlayerMode *this, ePlayerMode mode); // idb void __thiscall cPlayerMode::Update(cPlayerMode *this); // idb int __thiscall cPlayerMode::GetFade(cPlayerMode *this, unsigned __int8 *pR, unsigned __int8 *pG, unsigned __int8 *pB, float *pAlpha); // idb void __thiscall cPlayerMode::StartFadeIn(cPlayerMode *this, unsigned int time, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b); // idb @@ -20334,7 +20334,7 @@ void __thiscall ICerebellum::ICerebellum(ICerebellum *this); // idb ICerebellum *__thiscall ICerebellum::`vector deleting destructor'(ICerebellum *this, char __flags); void __thiscall ICerebellum::~ICerebellum(ICerebellum *this); // idb sPuppetMnvrRequest *__thiscall sPuppetMnvrRequest::`scalar deleting destructor'(sPuppetMnvrRequest *this, char __flags); -void __thiscall sBodyMsg::sBodyMsg(sBodyMsg *this, int obj_to, sBodyMsg::eBodyAction action, const char *motionName, int flagValue); +void __thiscall sBodyMsg::sBodyMsg(sBodyMsg *this, int obj_to, sBodyMsg::eBodyAction action, const char *motionName, unsigned int flagValue); void __thiscall cScrStr::cScrStr(cScrStr *this, const char *s); // idb char *__cdecl ScrStrDup(const char *pszSource); // idb void __thiscall sScrMsg::sScrMsg(sScrMsg *this); // idb @@ -20679,12 +20679,12 @@ void __thiscall cFileVar::cFileVar *__thiscall cFileVar::`scalar deleting destructor'(cFileVar *this, char __flags); sSkyMode *__thiscall cFileVar::Var(cFileVar *this); // idb void __cdecl cam_render_scene(Position *pos, long double zoom); // idb -void __cdecl Flash(float alpha, int flash_rgb); +void __cdecl Flash(float alpha, unsigned int flash_rgb); // idb void __cdecl composite(float *alpha, unsigned __int8 *rgb, float under_alpha, const unsigned __int8 *under_rgb); // idb int __cdecl RenderNewSky(); // idb ILoopClient *__stdcall CreateClient_5(sLoopClientDesc *pDesc, tLoopClientData__ *data); // idb int __stdcall LoopFunc_5(void *data, int msg, tLoopMessageData__ *hdata); // idb -void __cdecl do_stats(int time, int overhead, int blit_overhead); +void __cdecl do_stats(unsigned int time, unsigned int overhead, unsigned int blit_overhead); // idb void __cdecl superimpose_stats(int dt, int overhead, int blit_overhead); // idb int __cdecl hack_string(char *s, int x, int y); // idb void start_frame(); @@ -21890,7 +21890,7 @@ void __cdecl trace_add(char *arg); // idb void __cdecl trace_remove(char *arg); // idb void __cdecl trace_line(int iLine); // idb void trace_dump(); -void __cdecl dump_one_trace(cScrTrace *pTrace, int iMask); +void __cdecl dump_one_trace(const cScrTrace *pTrace, int iMask); // idb char *__cdecl dump_flag(int iFlag); // idb char *__cdecl dump_action(eScrTraceAction Action); // idb void trace_dump_active(); @@ -22028,9 +22028,9 @@ void __thiscall cClassDataOps::cClassDataOps(cClassDat cClassDataOps *__thiscall cClassDataOps::`scalar deleting destructor'(cClassDataOps *this, char __flags); void __thiscall cDList,1>::DestroyAll(cDList,1> *this); // idb cSimpleDListNode *__thiscall cDList,1>::GetFirst(cDList,1> *this); // idb -int __thiscall cSimpleListSet::AddElem(cSimpleListSet *this, cScriptProp::sModule *elem); +int __thiscall cSimpleListSet::AddElem(cSimpleListSet *this, cScriptProp::sModule *elem); // idb BOOL __thiscall cScriptProp::sModule::operator==(cScriptProp::sModule *this, const cScriptProp::sModule *m); -int __thiscall cSimpleListSet::RemoveElem(cSimpleListSet *this, cScriptProp::sModule *elem); +int __thiscall cSimpleListSet::RemoveElem(cSimpleListSet *this, cScriptProp::sModule *elem); // idb void __thiscall cSimpleListSet::RemoveAll(cSimpleListSet *this); // idb cSimpleDListNode *__thiscall cDListNode,1>::GetNext(cDListNode,1> *this); // idb cSimpleDListNode *__thiscall cSimpleDListNode::`scalar deleting destructor'(cSimpleDListNode *this, char __flags); @@ -22101,8 +22101,8 @@ void __thiscall cSimpleDListIter::sElem>::Next(cSimpleDLi void __thiscall cSimpleDListIter::sElem>::cSimpleDListIter::sElem>(cSimpleDListIter::sElem> *this, cSimpleDListNode::sElem> *node); // idb void __thiscall cDList::sElem>,1>::DestroyAll(cDList::sElem>,1> *this); // idb cSimpleDListNode::sElem> *__thiscall cDList::sElem>,1>::GetFirst(cDList::sElem>,1> *this); // idb -int __thiscall cSimpleListSet::sElem>::AddElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); -int __thiscall cSimpleListSet::sElem>::RemoveElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); +int __thiscall cSimpleListSet::sElem>::AddElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); // idb +int __thiscall cSimpleListSet::sElem>::RemoveElem(cSimpleListSet::sElem> *this, cDispatch::sElem *elem); // idb cSimpleDListNode::sElem> *__thiscall cDListNode::sElem>,1>::GetNext(cDListNode::sElem>,1> *this); // idb int __thiscall cDispatch::sElem::operator==(cDispatch::sElem *this, const cDispatch::sElem *e); // idb void __thiscall cSimpleDList::sElem>::Prepend(cSimpleDList::sElem> *this, const cDispatch::sElem *e); // idb @@ -22433,8 +22433,8 @@ cSongParams *__thiscall cSongParams::operator=(cSongParams *this, const sMission void __thiscall cFileVar::cFileVar(cFileVar *this); // idb cFileVar *__thiscall cFileVar::`vector deleting destructor'(cFileVar *this, char __flags); sMissionSongParams *__thiscall cFileVar::Var(cFileVar *this); // idb -int __thiscall cSpeechDomain::AddConcept(cSpeechDomain *this, Label *pName, int iPriority); // idb -int __thiscall cSpeechDomain::AddTag(cSpeechDomain *this, Label *pName, int iFlags); // idb +unsigned int __thiscall cSpeechDomain::AddConcept(cSpeechDomain *this, Label *pName, int iPriority); +unsigned int __thiscall cSpeechDomain::AddTag(cSpeechDomain *this, Label *pName, int iFlags); int __thiscall cSpeechDomain::AddValue(cSpeechDomain *this, Label *pName); // idb int __thiscall cSpeechDomain::ConceptIndex(cSpeechDomain *this, const Label *pName); // idb int __thiscall cSpeechDomain::TagIndex(cSpeechDomain *this, const Label *pName); // idb @@ -22619,10 +22619,10 @@ void __thiscall SpeechVoiceRelationsDestroy(void *this); void __cdecl SpeechRelationsDestroy(); // idb int SpeechDestroy(); void SpeechDatabasesDestroy(); -void __cdecl SpeechAddConcept(Label *pConceptName, int iPriority); -void __cdecl SpeechAddTag(Label *pTagName); -void __cdecl SpeechAddTagValue(Label *pTagValueName); -void __cdecl SpeechAddIntTag(Label *pTagName); +void __cdecl SpeechAddConcept(Label *pConceptName, int iPriority); // idb +void __cdecl SpeechAddTag(Label *pTagName); // idb +void __cdecl SpeechAddTagValue(Label *pTagValueName); // idb +void __cdecl SpeechAddIntTag(Label *pTagName); // idb void __cdecl SpeechVoiceNew(int VoiceObjID); // idb void __cdecl SpeechSchemaNewStart(const Label *pSchemaName, int SchemaObjID, const Label *pVoiceName, int iWeight, const Label *pConceptName); // idb void __cdecl SpeechSchemaNewAddIntTag(const Label *pTagName, int iMin, int iMax); // idb @@ -22691,7 +22691,7 @@ void __cdecl FindMatchingVertices(int contact_index); // idb unsigned int __cdecl FindPolygonWithVertexContact(sSphrContactData *contact_data, mxs_vector *point); int __cdecl SphrSpherecastStatic(Location *start_loc, Location *end_loc, float sphere_radius, unsigned __int8 flags); // idb unsigned __int8 __cdecl SphrSphereInWorld(Location *center_loc, float radius, unsigned __int8 flags); // idb -unsigned __int8 __cdecl PolygonIntersectsSphere(PortalCell *cell, PortalPolygonCore *polygon, int vertex_offset, mxs_vector *center, float radius); +unsigned __int8 __cdecl PolygonIntersectsSphere(PortalCell *cell, PortalPolygonCore *polygon, unsigned int vertex_offset, mxs_vector *center, float radius); // idb int SphrDumpCastResult(); long double __cdecl mxd_dot_vec(const mxds_vector *v1, const mxds_vector *v2); // idb int __cdecl SparkPropInit(); // idb @@ -22902,8 +22902,8 @@ void __thiscall cTagDBDatabase::cTagDBDatabase(cTagDBDatabase *this); // idb void __thiscall cTagDBDatabase::~cTagDBDatabase(cTagDBDatabase *this); // idb int __thiscall cTagDBDatabase::KeyInsertionIndex(cTagDBDatabase *this, cTagDBKey *pKey, int iMinIndex); // idb int __thiscall cTagDBDatabase::CopyDataToOutput(cTagDBDatabase *this, cTagDBOutput *pOutput, float fWeight); // idb -void __thiscall cTagDBDatabase::Insert(cTagDBDatabase *this, ITagDBKeySet *pSet, sTagDBData Data); -void __thiscall cTagDBDatabase::InsertRecursively(cTagDBDatabase *this, ITagDBKeySet *pSet, sTagDBData Data, unsigned int *pIter); +void __thiscall cTagDBDatabase::Insert(cTagDBDatabase *this, ITagDBKeySet *pSet, const sTagDBData Data); // idb +void __thiscall cTagDBDatabase::InsertRecursively(cTagDBDatabase *this, ITagDBKeySet *pSet, const sTagDBData Data, unsigned int *pIter); // idb int __thiscall cTagDBDatabase::MatchSubset(cTagDBDatabase *this, cTagDBInput *pInput, cTagDBOutput *pOutput); // idb int __thiscall cTagDBDatabase::MatchSubsetRecursively(cTagDBDatabase *this, cTagDBInput *pInput, cTagDBOutput *pOutput, int iInputIndex, float fWeight); // idb int __thiscall cTagDBDatabase::MatchSet(cTagDBDatabase *this, cTagDBInput *pInput, cTagDBOutput *pOutput); // idb @@ -23129,7 +23129,7 @@ void __thiscall cProperty::` int draw_random_stuff(); int __stdcall TestLoopFunc(void *context, int msg, tLoopMessageData__ *hdata); // idb ILoopClient *__stdcall CreateTestClient(sLoopClientDesc *pDesc, tLoopClientData__ *data); // idb -grs_bitmap *__cdecl texmemBuildCheckerboardTmap(int shift, int seed, int trans); // idb +grs_bitmap *__cdecl texmemBuildCheckerboardTmap(int shift, unsigned int seed, int trans); int __cdecl texmemUGradient(int x, int y, int size); int __cdecl texmemVGradient(int x, int y, int size); int __cdecl texmemUVGradient(int x, int y, int size); @@ -23167,9 +23167,9 @@ void __cdecl texmemGetHandlesFromRes(IRes **res_list, int *hnd_list, int cnt); / void __cdecl texmemCompressHandles(int *hnd_list); // idb IObjectSystem *terrainprop_load(); int __cdecl texture_Save(ITagFile *file); // idb -int __cdecl saveAllFamilies(ITagFile *file); // idb -int __cdecl saveGenericBlocked(ITagFile *file, blockHeader *hdr, const char *mem, _TagFileTag *tag, VersionNum *ver); -int __cdecl saveAllTextures(ITagFile *file); // idb +BOOL __cdecl saveAllFamilies(ITagFile *file); +BOOL __cdecl saveGenericBlocked(ITagFile *file, blockHeader *hdr, const char *mem, _TagFileTag *tag, VersionNum *ver); +BOOL __cdecl saveAllTextures(ITagFile *file); int __cdecl texture_Load(ITagFile *file); // idb int __cdecl loadAllFamilies(ITagFile *file); // idb char *__cdecl loadGenericBlocked(ITagFile *file, _TagFileTag *tag, VersionNum *ver, VersionNum *newver, blockHeader *hdr); @@ -23243,7 +23243,7 @@ void __stdcall FinalReleaseFunc_5(IUnknown *goof); // idb guiStyle *__cdecl uiGameStyle(); // idb void GameInitGUI(); char *__cdecl strip_trailing(char *arg); // idb -int __cdecl cfg_get_lang(const char *var, char *buf, int buflen); // idb +int __cdecl cfg_get_lang(const char *var, char *buf, size_t buflen); void GameTermGUI(); int GameCreateGUI(); int GameDestroyGUI(); @@ -23432,7 +23432,7 @@ PortalPlane *__cdecl AddExtraPlane(mxs_vector plane_norm, float plane_const); // PortalPlane *__cdecl FindPlaneInCell(mxs_vector *plane_norm, float plane_const, int cell_id); // idb int __cdecl FindPortalPlaneRec(mxs_vector *plane_norm, float plane_const, bsp_node *n, PortalPlane **pPlane, int *reversed); // idb int __cdecl FindPortalPlane(bsp_node *n, PortalPlane **pPlane, int *reversed); // idb -unsigned int __cdecl wrBspLeafCreate(unsigned int parent_index, int cell_id); // idb +unsigned int __cdecl wrBspLeafCreate(unsigned int parent_index, unsigned int cell_id); unsigned int __cdecl wrBspNodeCreate(bsp_node *n, int cell_id, unsigned int parent_index); // idb unsigned int __cdecl wrBspFindLeaf(int cell_id); // idb void __cdecl wrBspTreeRefCells(BspPlane (*node_index)[16]); @@ -23506,7 +23506,7 @@ void __cdecl cDARawSrvFns::PreSetSize(); void __cdecl cDARawSrvFns::PostSetSize(); void __cdecl cDARawSrvFns::ConstructItem(PortalPlane **pItem, PortalPlane *const *pFrom); // idb unsigned int __cdecl cHashTableFunctions::Hash(const int *k); // idb -unsigned int __cdecl cHashFunctions::Hash(unsigned int p); +unsigned int __cdecl cHashFunctions::Hash(int p); int __cdecl cHashTableFunctions::IsEqual(const int *k1, const int *k2); // idb BOOL __cdecl cHashFunctions::IsEqual(int p1, int p2); int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb @@ -23559,7 +23559,7 @@ int __stdcall cAITest::SuggestActions(cAITest *this, cAIGoal *pGoal, const cAIAc BOOL __thiscall cAITimer::Expired(cAITimer *this); void __thiscall cAITimer::Reset(cAITimer *this); // idb void __thiscall cAIAbility::SignalGoal(cAIAbility *this); // idb -void __thiscall cAITimer::Set(cAITimer *this, unsigned int period); +void __thiscall cAITimer::Set(cAITimer *this, eAITimerPeriod period); // idb void __thiscall cAIGotoGoal::cAIGotoGoal(cAIGotoGoal *this, IAIAbility *pOwner, unsigned int data); // idb void __thiscall cAIGoal::cAIGoal(cAIGoal *this, IAIAbility *pOwner, eAIGoalType goalType, unsigned int data); // idb cAIGoal *__thiscall cAIGoal::`vector deleting destructor'(cAIGoal *this, char __flags); @@ -23644,7 +23644,7 @@ int __cdecl GetAwarenessLink(int aiid, int objId, sAIAwareness **ppAwareness); / void __cdecl _E18_3(); // idb void __cdecl _E20_5(); // idb eAIResult __thiscall cAI::UpdateAction(cAI *this); // idb -int __thiscall cAI::UpdateGoal(cAI *this); +eAIResult __thiscall cAI::UpdateGoal(cAI *this); // idb int __thiscall cAI::CheckSignals(cAI *this, unsigned int signals); // idb void __thiscall cAI::ClearSignals(cAI *this); // idb void __thiscall cAI::DecideMode(cAI *this); // idb @@ -23844,8 +23844,8 @@ sAIEfficiency *__cdecl AIGetProperty(IAIEfficiencyProperty *pProp, int obj, sAIE eAIMode __cdecl AIGetProperty(IAIModeProperty *pProp, int obj, eAIMode defVal); // idb sAIAlertness *__cdecl AIGetProperty(IAIAlertnessProperty *pProp, int obj, sAIAlertness *defVal); // idb sAIAlertCap *__cdecl AIGetProperty(IAIAlertCapProperty *pProp, int obj, sAIAlertCap *defVal); // idb -sAIModeSuggestion *__cdecl _AIDecide(sAIModeSuggestion **ppOptions, unsigned int nOptions, int (__cdecl *pfnCompare)(const void *, const void *), sAIModeSuggestion *pTieBreakVoid); -cAIGoal *__cdecl _AIDecide(cAIGoal **ppOptions, int nOptions, int (__cdecl *pfnCompare)(const void *, const void *), cAIGoal *pTieBreakVoid); +sAIModeSuggestion *__cdecl _AIDecide(sAIModeSuggestion **ppOptions, size_t nOptions, int (__cdecl *pfnCompare)(const void *, const void *), sAIModeSuggestion *pTieBreakVoid); +cAIGoal *__cdecl _AIDecide(cAIGoal **ppOptions, size_t nOptions, int (__cdecl *pfnCompare)(const void *, const void *), cAIGoal *pTieBreakVoid); void __cdecl AITagMove(ITagFile *pTagFile, unsigned int *pItem); // idb void __cdecl AITagMoveDynarray(ITagFile *pTagFile, cDynArray *pDynarray); // idb void __cdecl AITagMove(ITagFile *pTagFile, int *pItem); // idb @@ -24714,14 +24714,14 @@ void __cdecl AITestMotion(char *str); // idb void TestRand(); void __cdecl AIAwareToggle(char *str); // idb void __cdecl AIForgetToggle(char *str); // idb -void __cdecl AICamToCell(int cell); // idb +void __cdecl AICamToCell(unsigned int cell); int AIPrintCamCell(); void __cdecl AIPrintIffyCells(float testVal); // idb void __cdecl AITestRecover(); // idb int AIValidateFleePoints(); IAIPath *GenericTest(); int AIReportLargeDoorSize(); -void __cdecl ForceAIMode(int nMode); // idb +void __cdecl ForceAIMode(eAIMode nMode); void __cdecl AIInstallCommands(); // idb cMxsVector *__thiscall cAIPathDB::GetCenter(cAIPathDB *this, unsigned int cell); cAI **__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); @@ -25177,7 +25177,7 @@ cAI **__thiscall cDABase>::operator[](cDABase>::Append(cDABase > *this, cAI *const *item); // idb int __thiscall cDABase>::SetSize(cDABase > *this, unsigned int newSize); // idb void __thiscall cDABase>::FastDeleteItem(cDABase > *this, unsigned int index); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); void __thiscall cDABase>::cDABase>(cDABase > *this); // idb void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb void __thiscall cDABase>::cDABase>(cDABase > *this); // idb @@ -25314,7 +25314,7 @@ char *__stdcall cAINetwork::GetName(cAINetwork *this); void __stdcall cAINetwork::Init(cAINetwork *this); // idb void __stdcall cAINetwork::OnModeChange(cAINetwork *this, eAIMode previous, eAIMode mode); // idb void __stdcall cAINetwork::OnSimStart(cAINetwork *this); // idb -void __cdecl cAIManager::handleTransferAI(int id, int size, void *pTransferData, cAIManager *pAIManager); // idb +void __cdecl cAIManager::handleTransferAI(int id, unsigned int size, void *pTransferData, cAIManager *pAIManager); int __stdcall cAIManager::IsProxy(cAIManager *this, int id); // idb int __stdcall cAIManager::GetAITransferInfo(cAIManager *this, int id, sAINetTransfer **ppTransfer); // idb int __stdcall cAIManager::MakeProxyAI(cAIManager *this, IAIBehaviorSet *id, int targetPlayer); @@ -25392,7 +25392,7 @@ void __stdcall cAISoundEnactor::OnModeChange(cAISoundEnactor *this, eAIMode prev void __stdcall cAISoundEnactor::HaltCurrent(cAISoundEnactor *this); // idb int __stdcall cAISoundEnactor::RequestConcept(cAISoundEnactor *this, unsigned int concept, const cTagSet *pTags); // idb int __stdcall cAISoundEnactor::RequestConcept(cAISoundEnactor *this, const char *pszConcept, const cTagSet *pTags); // idb -int __thiscall cAISoundEnactor::DoRequestConcept(cAISoundEnactor *this, sAISoundConceptDesc *pDesc, cTagSet *pTags); +int __thiscall cAISoundEnactor::DoRequestConcept(cAISoundEnactor *this, sAISoundConceptDesc *pDesc, cTagSet *pTags); // idb int __cdecl IsARobot(int id); // idb int __stdcall cAISoundEnactor::Save(cAISoundEnactor *this, ITagFile *pTagFile); // idb int __stdcall cAISoundEnactor::Load(cAISoundEnactor *this, ITagFile *pTagFile); // idb @@ -25566,7 +25566,7 @@ int __cdecl AICreateTag(int obj, unsigned int subTag, unsigned int addId, _TagFi int __cdecl AIOpenTagBlock(int obj, unsigned int subTag, unsigned int addId, unsigned int subTagVer, ITagFile *pTagFile); // idb BOOL __cdecl AITagModeWrite(ITagFile *pTagFile); void __cdecl AICloseTagBlock(ITagFile *pTagFile); // idb -void __cdecl AITagMoveRaw(ITagFile *pTagFile, char *pData, int nBytes); +void __cdecl AITagMoveRaw(ITagFile *pTagFile, char *pData, unsigned int nBytes); void __cdecl AITagMoveMultiParm(ITagFile *pTagFile, cMultiParm *pParm); // idb cMultiParm::uScratch *__thiscall cMultiParm::operator char const *(cMultiParm *this); void __cdecl AITagMove(ITagFile *pTagFile, eMultiParmType *pItem); // idb @@ -25587,8 +25587,8 @@ int __stdcall cAITriggeredPScripted::SuggestActions(cAITriggeredPScripted *this, cAITriggeredPScripted *__thiscall cAITriggeredPScripted::`vector deleting destructor'(cAITriggeredPScripted *this, char __flags); sAIPsdScrActs *__cdecl NewActs(eAIPriority priority, const sAIPsdScrAct *pActs, unsigned int n); // idb int __cdecl GetXYIntersection(const mxs_vector *line1a, const mxs_vector *line1b, const mxs_vector *line2a, const mxs_vector *line2b, mxs_vector *pResult); // idb -int __cdecl GetXYSegmentIntersect(mxs_vector *seg1a, mxs_vector *seg1b, mxs_vector *seg2a, mxs_vector *seg2b, mxs_vector *pResult); -int __cdecl GetXYLineSegIntersect(const mxs_vector *line1a, const mxs_vector *line1b, mxs_vector *seg2a, mxs_vector *seg2b, mxs_vector *pResult); +int __cdecl GetXYSegmentIntersect(mxs_vector *seg1a, mxs_vector *seg1b, mxs_vector *seg2a, mxs_vector *seg2b, mxs_vector *pResult); // idb +int __cdecl GetXYLineSegIntersect(const mxs_vector *line1a, const mxs_vector *line1b, mxs_vector *seg2a, mxs_vector *seg2b, mxs_vector *pResult); // idb int __cdecl GetObjPosition(int obj, Position *p); // idb cMxsVector *__cdecl GetObjLocation(int obj); void __cdecl _E6_15(); // idb @@ -26228,7 +26228,7 @@ const mxs_vector *__thiscall cAICombat::GetTargetLoc(cAICombat *this); // idb int __thiscall cAICombat::SeekCombat(cAICombat *this); // idb void __thiscall cAICombat::CheckLostContact(cAICombat *this); // idb BOOL __thiscall cAICombat::IsValidTarget(cAICombat *this, int object); -BOOL __thiscall cAICombat::IsAcquirableTarget(cAICombat *this, sAIAwareness *awareness); +BOOL __thiscall cAICombat::IsAcquirableTarget(cAICombat *this, const sAIAwareness *awareness); eAIPriority __thiscall cAICombat::TargetPriority(cAICombat *this, int object); // idb int __thiscall cAICombat::TargetScan(cAICombat *this); // idb int __thiscall cAICombat::SelectTarget(cAICombat *this); // idb @@ -26236,7 +26236,7 @@ int __cdecl TargetSort(const sTargScanInfo *pLeft, const sTargScanInfo *pRight); void __thiscall cAICombat::SetTarget(cAICombat *this, int target); // idb BOOL __thiscall cAICombat::IsRetainableTarget(cAICombat *this, const sAIAwareness *awareness); void __thiscall cAICombat::UpdateTargets(cAICombat *this); // idb -int __thiscall cAICombat::IsHostileToward(cAICombat *this, int obj); // idb +BOOL __thiscall cAICombat::IsHostileToward(cAICombat *this, int obj); BOOL __cdecl DoesProvokeBloodlust(int us, int them); void __thiscall cAICombatTimingProperty::cAICombatTimingProperty(cAICombatTimingProperty *this); // idb const sPropertyTypeDesc *__stdcall cAICombatTimingProperty::DescribeType(cAICombatTimingProperty *this); // idb @@ -26347,7 +26347,7 @@ BOOL __thiscall cAIDevice::ReadyToDeactivate(cAIDevice *this); BOOL __thiscall cAIDevice::ReadyToActivate(cAIDevice *this); void __stdcall cAIDevice::OnAlertness(cAIDevice *this, int source, eAIAwareLevel previous, eAIAwareLevel current, const sAIAlertness *pRaw); // idb int __stdcall cAIDevice::SuggestGoal(cAIDevice *this, cAIGoal *pPrevious, cAIGoal **ppNew); // idb -void __stdcall cAIDevice::OnGoalChange(cAIDevice *this, const cAIGoal *pPrevious, cAIGoal *pGoal); +void __stdcall cAIDevice::OnGoalChange(cAIDevice *this, const cAIGoal *pPrevious, cAIGoal *pGoal); // idb void __stdcall cAIDevice::OnActionProgress(cAIDevice *this, IAIAction *pAction); // idb int __thiscall cAIDevice::IsDoing(cAIDevice *this, const cAIActions *actions, unsigned int type); // idb int __thiscall cAIDevice::ShouldChangeFacing(cAIDevice *this); // idb @@ -26541,7 +26541,7 @@ cAIProxAction *__thiscall cAIProxAction::`vector deleting destructor'(cAIProxAct void __thiscall cAIPsdScrAction::~cAIPsdScrAction(cAIPsdScrAction *this); // idb eAIResult __stdcall cAIPsdScrAction::Update(cAIPsdScrAction *this); // idb eAIResult __stdcall cAIPsdScrAction::Enact(cAIPsdScrAction *this, unsigned int deltaTime); // idb -cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this); +cAIOrientAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this); void __cdecl AddMetaPropertyToMany(int metaProp, const cDynArray *targets); // idb void __cdecl RemoveMetaPropertyFromMany(int metaProp, const cDynArray *targets); // idb void __cdecl CreateLinks(IRelation *pRelation, const cDynArray *sources, const cDynArray *destinations, void *pData); // idb @@ -26838,7 +26838,7 @@ int __stdcall cAIConverse::SuggestGoal(cAIConverse *this, cAIGoal *pPrevious, cA void __stdcall cAIConverse::OnGoalChange(cAIConverse *this, const cAIGoal *pPrevious, const cAIGoal *pGoal); // idb int __stdcall cAIConverse::SuggestActions(cAIConverse *this, cAIGoal *pGoal, const cAIActions *previous, cAIActions *pNew); // idb void __stdcall cAIConverse::OnActionChange(cAIConverse *this, IAIAction *pPrevious, IAIAction *pAction); // idb -void __stdcall cAIConverse::Start(cAIConverse *this, IInternalAI *pConversation, int actorID); +void __stdcall cAIConverse::Start(cAIConverse *this, IInternalAI *pConversation, unsigned int actorID); void __stdcall cAIConverse::NewActions(cAIConverse *this, sAIPsdScrAct *pActions, unsigned int nActions); // idb void __stdcall cAIConverse::Terminate(cAIConverse *this); // idb int __stdcall cAIConverse::GetCurrentAction(cAIConverse *this); // idb @@ -27555,7 +27555,7 @@ int __stdcall cAIPatrol::Save(cAIPatrol *this, ITagFile *pTagFile); // idb int __stdcall cAIPatrol::Load(cAIPatrol *this, ITagFile *pTagFile); // idb void __stdcall cAIPatrol::OnSimStart(cAIPatrol *this); // idb void __stdcall cAIPatrol::OnUpdateProperties(cAIPatrol *this, eAIPropUpdateKind kind); // idb -void __stdcall cAIPatrol::OnGoalProgress(cAIPatrol *this, cAIGoal *pGoal); +void __stdcall cAIPatrol::OnGoalProgress(cAIPatrol *this, cAIGoal *pGoal); // idb void __stdcall cAIPatrol::OnModeChange(cAIPatrol *this, eAIMode previous, eAIMode mode); // idb void __stdcall cAIPatrol::OnDefend(cAIPatrol *this, const sAIDefendPoint *pPoint); // idb BOOL __stdcall cAIPatrol::SuggestGoal(cAIPatrol *this, cAIGoal *pCurrentGoal, cAIGoal **ppGoal); @@ -27912,7 +27912,7 @@ int __stdcall cAIPath::Backup(cAIPath *this); // idb unsigned int __stdcall cAIPath::GetPathEdgeCount(cAIPath *this); void __stdcall cAIPath::GetPathEdge(cAIPath *this, int edgeIndex, cAIPathEdge *edge); // idb const cAIPathEdge *__stdcall cAIPath::GetCurEdge(cAIPath *this); // idb -void __thiscall cAIPath::Append(cAIPath *this, cAIPath *p); +void __thiscall cAIPath::Append(cAIPath *this, cAIPath *p); // idb void __thiscall cAIPath::SetCurrentPathEdgeAtStart(cAIPath *this); // idb int __thiscall cAIPath::IsNextEdgeVisible(cAIPath *this, const cMxsVector *fromPt, unsigned int startCell, unsigned __int8 nStressBits); // idb int __stdcall cAIPath::IsDestVisible(cAIPath *this, const cMxsVector *fromPt, unsigned int startCell, unsigned __int8 nStressBits); // idb @@ -27966,9 +27966,9 @@ void __thiscall cAIPathDB::Term(cAIPathDB *this); // idb double __thiscall cAIPathDB::GetHighestZ(cAIPathDB *this, unsigned int cell); double __thiscall cAIPathDB::GetLowestZ(cAIPathDB *this, unsigned int cell); double __thiscall cAIPathDB::ComputeArea(cAIPathDB *this, unsigned int cell); -int __thiscall cAIPathDB::SplitCell(cAIPathDB *this, unsigned int cell, mxs_vector *pt1, mxs_vector *pt2); -int __fastcall AICreateOrFindPathVertex(cMxsVector *vertex, unsigned int *pId); -int __fastcall AIPathVertexAlreadyExists(cMxsVector *vertex, unsigned int *pId); +int __thiscall cAIPathDB::SplitCell(cAIPathDB *this, unsigned int cell, mxs_vector *pt1, mxs_vector *pt2); // idb +int __fastcall AICreateOrFindPathVertex(cMxsVector *vertex, unsigned int *pId); // idb +int __fastcall AIPathVertexAlreadyExists(cMxsVector *vertex, unsigned int *pId); // idb void __thiscall cAIPathDB::DeleteCell(cAIPathDB *this, unsigned int cell); // idb void __thiscall cAIPathDB::GetCell(cAIPathDB *this, unsigned int cell, sAIExternCell **ppCell); // idb int __thiscall cAIPathDB::AddOBBCell(cAIPathDB *this, sAIExternCell *pCell, unsigned int cell, int movable); // idb @@ -28014,7 +28014,7 @@ void __cdecl FindAdjunctData(int iCellIndex, sAIPathCellAdjunct *pAdjunct); // i int __cdecl CellStairLevel(int iCellIndex); // idb int __cdecl EdgeStairLevel(mxs_vector *p1, mxs_vector *p2); // idb BOOL __cdecl CellIsRamp(int iCellIndex); -int __cdecl CellBlockedDirections(int iCellIndex); // idb +int __cdecl CellBlockedDirections(unsigned int iCellIndex); double __cdecl AdjunctCeiling(Location *pSamplePoint, int iCellIndex, float fMinCeilingZ); void __cdecl SetCellInfoFromAdjunct(int iCellIndex, sAIPathCellAdjunct *pAdjunct, sAIPathCell *pCell); // idb void __cdecl ProcessOpenDirections(int iCellIndex); // idb @@ -28022,13 +28022,13 @@ void __cdecl VolumeCigarAtCenter(int iCellIndex); // idb void ClearAdjunctData(); unsigned int PropagateFloorTypes(); void PostProcessModifiedOkBits(); -BOOL __cdecl EdgesDoNotIntersect(int iFromCell, sAIPathCellLink *pLink, float *fZDiff); +BOOL __cdecl EdgesDoNotIntersect(unsigned int iFromCell, sAIPathCellLink *pLink, float *fZDiff); BOOL __cdecl EdgeIsLower(mxs_vector *v1a, mxs_vector *v1b, mxs_vector *v2a, mxs_vector *v2b); int __fastcall AIPathCellsShareEdge(); // idb -int __fastcall IsSharedEdge(cMxsVector *edgePt_1a, cMxsVector *edgePt_1b, cMxsVector *edgePt_2a, cMxsVector *edgePt_2b, sIsSharedEdgeResult *pResult); +int __fastcall IsSharedEdge(cMxsVector *edgePt_1a, cMxsVector *edgePt_1b, cMxsVector *edgePt_2a, cMxsVector *edgePt_2b, sIsSharedEdgeResult *pResult); // idb unsigned int ValidateAllCells(); void AddBlockingOBBs(); -void __cdecl AISegmentSplit(mxs_vector *start, mxs_vector *end); +void __cdecl AISegmentSplit(mxs_vector *start, mxs_vector *end); // idb void __cdecl SegSpltFindCloseCells(const mxs_vector *start, const mxs_vector *end, float distSq, cDynArray *pResult); // idb void __cdecl SegSpltFindCloseCellsByCenter(const mxs_vector *location, float distSq, cDynArray *pResult); // idb void __cdecl SegSpltFindCloseCellsByVertices(const mxs_vector *location, float distSq, cDynArray *pResult); // idb @@ -28113,7 +28113,7 @@ void __thiscall cMxsVector::Set(cMxsVector *this, cMxsVector *v); cMxsVector *__thiscall cAIPathDB::GetCenter(cAIPathDB *this, unsigned int cell, cMxsVector *pCenter); void __cdecl SetCellEdgeInfo(); void __cdecl SetCellEdgeLinked(); -void __thiscall cMxsVector::Set(cMxsVector *this, float xx, float yy, float zz); // idb +void __thiscall cMxsVector::Set(cMxsVector *this, unsigned int xx, unsigned int yy, float zz); void __cdecl ComputeCellLightLevels(); // idb void __cdecl ComputeCell2CellCost(unsigned int cell_1, unsigned int cell_2, unsigned __int8 *cost); const sAIPathCellPlane *__thiscall cAIPathDB::GetCellPlane(cAIPathDB *this, unsigned int cell); @@ -28272,7 +28272,7 @@ void __thiscall cDABase>::cDABase>::~cDABase>(cDABase > *this); // idb unsigned __int8 *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); // idb int __thiscall cDABase>::SetSize(cDABase > *this, unsigned int newSize); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb unsigned int *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); unsigned int __thiscall cDABase>::Grow(cDABase > *this, unsigned int num); // idb @@ -28360,7 +28360,7 @@ void _E11_17(); void _E10_15(); void _E14_16(); void _E13_14(); -int __cdecl AIPathcastVia(const mxs_vector *startPoint, unsigned int startCell, const mxs_vector *endPoint, unsigned int viaCell, unsigned int *pEndCell, unsigned __int8 OkBits, IAIPathfindControl *pControl); // idb +BOOL __cdecl AIPathcastVia(const mxs_vector *startPoint, unsigned int startCell, const mxs_vector *endPoint, unsigned int viaCell, unsigned int *pEndCell, unsigned __int8 OkBits, IAIPathfindControl *pControl); unsigned int __cdecl FindNextCell(unsigned int cellID, int fAllowBlockedOBBs); int __cdecl AIPathcast(const mxs_vector *startPoint, unsigned int startCell, const mxs_vector *endPoint, unsigned int *pEndCell, unsigned __int8 OkBits, IAIPathfindControl *pControl); // idb void __cdecl AISetPathcastIgnoreBlockingOBBs(int b); // idb @@ -28384,7 +28384,7 @@ void __cdecl AIPathDrawCellsToggle(); // idb void __cdecl AIPathDrawCellIdsToggle(); // idb void __cdecl AIPathDrawLinksToggle(int i); // idb void __cdecl AIDebugDumpCellVertexInfo(int cell_id); // idb -void __cdecl AIDebugDumpCellConnectionInfo(int cell_id); // idb +void __cdecl AIDebugDumpCellConnectionInfo(unsigned int cell_id); void __cdecl ValidateAllCellRooms(int linkedOnly, cDynArray *pFailures); // idb void __thiscall cDynArray::~cDynArray(cDynArray *this); // idb void __thiscall cDynArray_::~cDynArray_(cDynArray_ *this); // idb @@ -28496,7 +28496,7 @@ void __cdecl sZoneOkBitsMap::operator delete(void *p, unsigned int n); // idb int ResetPathfindZones(); void DeterminePathfindZones(); void __cdecl DoDeterminePathfindZones(eAIPathZoneType ZoneType, unsigned __int8 nOkBits); -int LinkPathfindZones(); +__int32 LinkPathfindZones(); void __cdecl DoLinkPathfindZones(eAIPathZoneType ZoneType); // idb unsigned int FixupPathfindZones(); void __thiscall _cPoolWrapper::_cPoolWrapper(_cPoolWrapper *this, unsigned int size); // idb @@ -28513,8 +28513,8 @@ void __thiscall cDynArray_::cDynArray_(cDynArray void __thiscall cDynArray_::cDynArray_(cDynArray_ *this, int size); // idb tHashSetNode__ *__thiscall cHashSet::RemoveByKey(cHashSet *this, tHashSetKey__ *k); unsigned __int16 *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); unsigned __int8 *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); // idb void InitAIRoomDatabase(); void *TermAIRoomDatabase(); @@ -31078,8 +31078,8 @@ int __stdcall cAISenses::ClearSense(cAISenses *this, int objId); // idb const sAIAwareness *__stdcall cAISenses::GetHighAwareness(cAISenses *this, char flags, unsigned int maxLastContact); const sAIAwareness *__stdcall cAISenses::GetAwareness(cAISenses *this, int target); // idb unsigned int __stdcall cAISenses::GetAllAwareness(cAISenses *this, cDynArray *pResult); -void __thiscall cAISenses::SetAwareness(cAISenses *this, int objId, int linkId, sAIAwareness *pAwareness); -void __thiscall cAISenses::TestForget(cAISenses *this, int linkId, sAIAwareness *pAwareness); +void __thiscall cAISenses::SetAwareness(cAISenses *this, int objId, int linkId, const sAIAwareness *pAwareness); // idb +void __thiscall cAISenses::TestForget(cAISenses *this, int linkId, const sAIAwareness *pAwareness); // idb int __thiscall cAISenses::Look(cAISenses *this, const cAISenses::sVisionArgs *args, sAIAwareness *pAwareness); eAIAwareLevel __thiscall cAISenses::Listen(cAISenses *this, int objId, sAIAwareness *pAwareness, mxs_vector *pSoundPos); // idb int __thiscall cAISenses::Pulse(cAISenses *this, sAIAwareness *pAwareness, eAIAwareLevel visionPulse, const mxs_vector *visionPos, eAIAwareLevel soundPulse, const mxs_vector *soundPos); // idb @@ -31090,7 +31090,7 @@ floatang *__thiscall cAISenses::GetVisionFacing(cAISenses *this, floatang *resul const sAIAwareCapacitor *__thiscall cAISenses::GetCapacitor(cAISenses *this); // idb BOOL __thiscall cAISenses::FunctionallySofter(cAISenses *this, const sSoundInfo *pSoundInfoNew, const sSoundInfo *pSoundInfoOld); int __stdcall cAISenses::Hears(cAISenses *this, const sSoundInfo *pSoundInfo, const sAISoundType *pType); // idb -void __stdcall cAISenses::KeepFresh(cAISenses *this, int obj, signed int duration); +void __stdcall cAISenses::KeepFresh(cAISenses *this, int obj, eAITimerPeriod duration); void __thiscall cAISenses::GetBestInWorld(cAISenses *this, const mxs_vector *original, mxs_vector *pResult); // idb void __thiscall cAISenses::ProcessPositionSounds(cAISenses *this); // idb void __thiscall cAISenses::InformFrom(cAISenses *this, int from); // idb @@ -31186,9 +31186,9 @@ void __cdecl AIPathFindDrawPath(); void __thiscall cAIState::GetLocation(cAIState *this, cMxsVector *pLoc); // idb char *__stdcall cAIFlowDebugger::GetName(cAIFlowDebugger *this); void __stdcall cAIFlowDebugger::OnActionProgress(cAIFlowDebugger *this, IAIAction *pAction); // idb -void __stdcall cAIFlowDebugger::OnGoalProgress(cAIFlowDebugger *this, cAIGoal *pGoal); +void __stdcall cAIFlowDebugger::OnGoalProgress(cAIFlowDebugger *this, cAIGoal *pGoal); // idb void __stdcall cAIFlowDebugger::OnModeChange(cAIFlowDebugger *this, eAIMode previous, eAIMode mode); // idb -void __stdcall cAIFlowDebugger::OnGoalChange(cAIFlowDebugger *this, const cAIGoal *pPrevious, cAIGoal *pGoal); +void __stdcall cAIFlowDebugger::OnGoalChange(cAIFlowDebugger *this, const cAIGoal *pPrevious, cAIGoal *pGoal); // idb void __stdcall cAIFlowDebugger::OnActionChange(cAIFlowDebugger *this, IAIAction *pPrevious, IAIAction *pAction); // idb int _E6_19(); void _E3_17(); @@ -31218,12 +31218,12 @@ int __stdcall cAIBasicScript::Save(cAIBasicScript *this, ITagFile *pTagFile); // int __stdcall cAIBasicScript::Load(cAIBasicScript *this, ITagFile *pTagFile); // idb BOOL __stdcall cAIBasicScript::SaveGoal(cAIBasicScript *this, ITagFile *pTagFile, cAIGoal *pGoal); BOOL __stdcall cAIBasicScript::LoadGoal(cAIBasicScript *this, ITagFile *pTagFile, cAIGoal **ppGoal); -void __stdcall cAIBasicScript::OnGoalChange(cAIBasicScript *this, const cAIGoal *pPrevious, cAIGoal *pGoal); +void __stdcall cAIBasicScript::OnGoalChange(cAIBasicScript *this, const cAIGoal *pPrevious, cAIGoal *pGoal); // idb void __stdcall cAIBasicScript::OnModeChange(cAIBasicScript *this, eAIMode prev, eAIMode mode); // idb void __stdcall cAIBasicScript::OnActionChange(cAIBasicScript *this, IAIAction *pPrevious, IAIAction *pAction); // idb void __stdcall cAIBasicScript::OnActionProgress(cAIBasicScript *this, cAIMotionAction *pAction); void __stdcall cAIBasicScript::OnAlertness(cAIBasicScript *this, int source, eAIScriptAlertLevel previous, eAIScriptAlertLevel current, const sAIAlertness *pRaw); -void __stdcall cAIBasicScript::OnHighAlert(cAIBasicScript *this, int source, eAIAwareLevel previous, eAIAwareLevel current, const sAIAlertness *pRaw); // idb +void __stdcall cAIBasicScript::OnHighAlert(cAIBasicScript *this, int source, eAIScriptAlertLevel previous, eAIScriptAlertLevel current, const sAIAlertness *pRaw); void __stdcall cAIBasicScript::OnSignal(cAIBasicScript *this, const sAISignal *pSignal); // idb eAIResult __stdcall cAIBasicScript::UpdateGoal(cAIBasicScript *this, cAIGoal *pGoal); // idb int __stdcall cAIBasicScript::SuggestGoal(cAIBasicScript *this, cAIGoal *pPrevious, cAIGoal **ppGoal); // idb @@ -31327,11 +31327,11 @@ void __thiscall cAIScrSrv::~cAIScrSrv(cAIScrSrv *this); // idb void __thiscall cAIScrSrv::cAIScrSrv(cAIScrSrv *this); // idb void __stdcall cAIScrSrv::Init(cAIScrSrv *this); // idb void __stdcall cAIScrSrv::End(cAIScrSrv *this); // idb -true_bool *__stdcall cAIScrSrv::MakeGotoObjLoc(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, eAIScriptSpeed objIdTarget, eAIActionPriority speed, const cMultiParm *priority); -true_bool *__stdcall cAIScrSrv::MakeFrobObj(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, eAIActionPriority objIdTarget, const cMultiParm *priority); -true_bool *__stdcall cAIScrSrv::MakeFrobObj(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, object *objIdTarget, eAIActionPriority objWith, const cMultiParm *priority); +true_bool *__stdcall cAIScrSrv::MakeGotoObjLoc(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, eAIScriptSpeed objIdTarget, eAIActionPriority speed, const cMultiParm *priority); // idb +true_bool *__stdcall cAIScrSrv::MakeFrobObj(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, eAIActionPriority objIdTarget, const cMultiParm *priority); // idb +true_bool *__stdcall cAIScrSrv::MakeFrobObj(cAIScrSrv *this, true_bool *result, int __$ReturnUdt, object *objIdAI, object *objIdTarget, eAIActionPriority objWith, const cMultiParm *priority); // idb eAIAwareLevel __stdcall cAIScrSrv::GetAlertLevel(cAIScrSrv *this, int objIdAI); -void __stdcall cAIScrSrv::SetMinimumAlert(cAIScrSrv *this, int objIdAI, eAIAwareLevel level); +void __stdcall cAIScrSrv::SetMinimumAlert(cAIScrSrv *this, int objIdAI, eAIScriptAlertLevel level); // idb void __stdcall cAIScrSrv::ClearGoals(cAIScrSrv *this, int objIdAI); // idb void __stdcall cAIScrSrv::SetScriptFlags(cAIScrSrv *this, int objIdAI, char fFlags); void __stdcall cAIScrSrv::ClearAlertness(cAIScrSrv *this, int objIdAI); // idb @@ -31415,7 +31415,7 @@ int __thiscall cContainSys::contains_link(cContainSys *this, int container, int int __stdcall cContainSys::IsHeld(cContainSys *this, int container, int containee); // idb int __stdcall cContainSys::Contains(cContainSys *this, int container, int containee); // idb int __stdcall cContainSys::GetContainer(cContainSys *this, int obj); // idb -int __stdcall cContainSys::MoveAllContents(cContainSys *this, int targ, int src, int addflags); // idb +int __stdcall cContainSys::MoveAllContents(cContainSys *this, int targ, int src, unsigned int addflags); BOOL __stdcall cContainSys::CanCombine(cContainSys *this, int combinee, int new_obj, int type); int __stdcall cContainSys::CanCombineContainer(cContainSys *this, int container, int new_obj, int type); // idb int __stdcall cContainSys::CombineTry(cContainSys *this, int combinee, int new_obj, int type); // idb @@ -31536,7 +31536,7 @@ void __thiscall cContainSrv::~cContainSrv(cContainSrv *this); // idb void __thiscall cContainSrv::cContainSrv(cContainSrv *this); // idb void __stdcall cContainSrv::Init(cContainSrv *this); // idb void __stdcall cContainSrv::End(cContainSrv *this); // idb -int __stdcall cContainSrv::Add(cContainSrv *this, object obj, object container, int type, int flags); // idb +int __stdcall cContainSrv::Add(cContainSrv *this, object obj, object container, int type, unsigned int flags); int __stdcall cContainSrv::Remove(cContainSrv *this, object obj, object container); // idb int __stdcall cContainSrv::MoveAllContents(cContainSrv *this, object src, object targ, int flags); // idb int __stdcall cContainSrv::StackAdd(cContainSrv *this, object src, int quantity); // idb @@ -32181,7 +32181,7 @@ void _E14_22(); void _E13_19(); void __thiscall cKeySrv::~cKeySrv(cKeySrv *this); // idb void __thiscall cKeySrv::cKeySrv(cKeySrv *this); // idb -int __stdcall cKeySrv::TryToUseKey(cKeySrv *this, object *key_object, object *locked_object, eKeyUse how); +int __stdcall cKeySrv::TryToUseKey(cKeySrv *this, object *key_object, object *locked_object, eKeyUse how); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cKeySrv *__thiscall cKeySrv::`vector deleting destructor'(cKeySrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -32308,7 +32308,7 @@ void _E14_23(); void _E13_21(); void __thiscall cLockedSrv::~cLockedSrv(cLockedSrv *this); // idb void __thiscall cLockedSrv::cLockedSrv(cLockedSrv *this); // idb -int __stdcall cLockedSrv::IsLocked(cLockedSrv *this, object *sobj); +int __stdcall cLockedSrv::IsLocked(cLockedSrv *this, object *sobj); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cLockedSrv *__thiscall cLockedSrv::`vector deleting destructor'(cLockedSrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -32411,24 +32411,24 @@ int _E16_5(); void __cdecl _E15_13(); // idb int __cdecl fillNetParms(sfx_parm *parm, sfx_net_parm *net_parm, sfx_small_net_parm *small_net_parm); // idb void __cdecl fillParms(sfx_parm *parm, sfx_net_parm *net_parm); // idb -void __cdecl soundNetEndCallback(int localHandle, void *pClientData); // idb +void __cdecl soundNetEndCallback(unsigned int localHandle, void *pClientData); void __cdecl fillParmsSmall(sfx_parm *parm, sfx_small_net_parm *net_parm); // idb -void __cdecl handleSoundObj(int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, int owner); // idb -void __cdecl makeSoundObj(int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, int owner); // idb +void __cdecl handleSoundObj(unsigned int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, unsigned int owner); +void __cdecl makeSoundObj(unsigned int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, unsigned int owner); int __cdecl OwnHandle(unsigned int owner, unsigned int handle); // idb -void __cdecl soundNetAddMapping(int remoteHandle, int localHandle, int owner); // idb -void __cdecl handleSmallSoundObj(int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, int owner); // idb +void __cdecl soundNetAddMapping(unsigned int remoteHandle, unsigned int localHandle, unsigned int owner); +void __cdecl handleSmallSoundObj(unsigned int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, unsigned int owner); void __cdecl SoundNetGenerateSoundObj(int handle, int objID, int schemaID, const char *sampleName, float atten_factor, sfx_parm *parms); // idb -void __cdecl handleSoundVec(int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, int owner); // idb -void __cdecl makeSoundVec(int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, int owner); // idb -void __cdecl handleSmallSoundVec(int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, int owner); // idb +void __cdecl handleSoundVec(unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, unsigned int owner); +void __cdecl makeSoundVec(unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, unsigned int owner); +void __cdecl handleSmallSoundVec(unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, unsigned int owner); void __cdecl SoundNetGenerateSoundVec(int handle, mxs_vector *vec, int schemaID, const char *sampleName, float atten_factor, sfx_parm *parms); // idb -void __cdecl handleSound(int handle, const char *sampleName, sfx_net_parm *net_parms, int owner); // idb -void __cdecl makeSound(int handle, const char *sampleName, sfx_parm *parm, int owner); // idb -void __cdecl handleSmallSound(int handle, const char *sampleName, sfx_small_net_parm *net_parms, int owner); // idb +void __cdecl handleSound(unsigned int handle, const char *sampleName, sfx_net_parm *net_parms, unsigned int owner); +void __cdecl makeSound(unsigned int handle, const char *sampleName, sfx_parm *parm, unsigned int owner); +void __cdecl handleSmallSound(unsigned int handle, const char *sampleName, sfx_small_net_parm *net_parms, unsigned int owner); void __cdecl SoundNetGenerateSound(int handle, const char *sampleName, sfx_parm *parms); // idb -void __cdecl handleSoundHalt(int handle, int owner); // idb -void __cdecl SoundNetHalt(int handle); // idb +void __cdecl handleSoundHalt(unsigned int handle, unsigned int owner); +void __cdecl SoundNetHalt(unsigned int handle); cNetMsg *SoundNetInit(); cNetMsg *SoundNetTerm(); void __thiscall cDWORDSet::cDWORDSet(cDWORDSet *this); // idb @@ -33159,10 +33159,10 @@ void __cdecl cDARawSrvFns::OnDeleteItem(); int __thiscall cDABase>::Resize(cDABase > *this, unsigned int newSlotCount); // idb IRelation *InitWeaponHaloSystem(); unsigned int TermWeaponHaloSystem(); -int __cdecl WeaponHaloInflated(int weapon); // idb +BOOL __cdecl WeaponHaloInflated(int weapon); BOOL __cdecl WeaponSubmodIsHalo(int weapon, int submod); -int __cdecl WeaponHaloIsBlocking(int objID); // idb -int __cdecl WeaponGetBlockingHalo(int objID, int *haloId); // idb +BOOL __cdecl WeaponHaloIsBlocking(int objID); +BOOL __cdecl WeaponGetBlockingHalo(int objID, int *haloId); double __cdecl WeaponHaloQuadDist(int objID, int halo_id, mxs_vector *subPos); void __cdecl WeaponHaloInit(int objID, int weapon); void __cdecl WeaponHaloTerm(int objID, int weapon); // idb @@ -34083,7 +34083,7 @@ int __stdcall cActReactSrv::React(cActReactSrv *this, reaction_kind what, float int __stdcall cActReactSrv::Stimulate(cActReactSrv *this, object who, object what, float how_much, object srcobj); // idb BOOL __thiscall object::operator!=(object *this, const object *o); unsigned int __stdcall cActReactSrv::GetReactionNamed(cActReactSrv *this, const char *name); -cScrStr *__stdcall cActReactSrv::GetReactionName(cActReactSrv *this, cScrStr *result, int __$ReturnUdt); // idb +cScrStr *__stdcall cActReactSrv::GetReactionName(cActReactSrv *this, cScrStr *result, unsigned int __$ReturnUdt); int __stdcall cActReactSrv::SubscribeToStimulus(cActReactSrv *this, object obj, object what); // idb int __stdcall cActReactSrv::UnsubscribeToStimulus(cActReactSrv *this, object obj, object what); // idb int __stdcall cActReactSrv::BeginContact(cActReactSrv *this, object source, object sensor); // idb @@ -34251,8 +34251,8 @@ void _E14_32(); void _E13_26(); void __thiscall cDebugScrSrv::~cDebugScrSrv(cDebugScrSrv *this); // idb void __thiscall cDebugScrSrv::cDebugScrSrv(cDebugScrSrv *this); // idb -int __stdcall cDebugScrSrv::MPrint(cDebugScrSrv *this, cScrStr *s1, cScrStr *s2, cScrStr *s3, cScrStr *s4, cScrStr *s5, cScrStr *s6, cScrStr *s7, cScrStr *s8); -int __stdcall cDebugScrSrv::Command(cDebugScrSrv *this, cScrStr *s1, cScrStr *s2, cScrStr *s3, cScrStr *s4, cScrStr *s5, cScrStr *s6, cScrStr *s7, cScrStr *s8); +int __stdcall cDebugScrSrv::MPrint(cDebugScrSrv *this, cScrStr *s1, cScrStr *s2, cScrStr *s3, cScrStr *s4, cScrStr *s5, cScrStr *s6, cScrStr *s7, cScrStr *s8); // idb +int __stdcall cDebugScrSrv::Command(cDebugScrSrv *this, cScrStr *s1, cScrStr *s2, cScrStr *s3, cScrStr *s4, cScrStr *s5, cScrStr *s6, cScrStr *s7, cScrStr *s8); // idb int __stdcall cDebugScrSrv::Break(cDebugScrSrv *this); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cDebugScrSrv *__thiscall cDebugScrSrv::`scalar deleting destructor'(cDebugScrSrv *this, char __flags); @@ -34296,12 +34296,12 @@ true_bool *__stdcall cLinkSrv::AnyExist(cLinkSrv *this, true_bool *result, linkk linkset *__stdcall cLinkSrv::GetAll(cLinkSrv *this, linkset *result, linkkind __$ReturnUdt, object kind, object from); // idb void __thiscall linkset::linkset(linkset *this, ILinkQuery *q); // idb link *__stdcall cLinkSrv::GetOne(cLinkSrv *this, link *result, linkkind __$ReturnUdt, object kind, object from); // idb -int __stdcall cLinkSrv::BroadcastOnAllLinks(cLinkSrv *this, object *SelfObj, const char *Message, linkkind recipients, const cMultiParm *linkdata); +int __stdcall cLinkSrv::BroadcastOnAllLinks(cLinkSrv *this, object *SelfObj, const char *Message, linkkind recipients, const cMultiParm *linkdata); // idb BOOL __thiscall cMultiParm::operator==(cMultiParm *this, const cMultiParm *m); void __thiscall sScrMsg::sScrMsg(sScrMsg *this, int fromWhom, int toWhom, const char *pszMessage, const cMultiParm *initData); // idb -int __stdcall cLinkSrv::BroadcastOnAllLinks(cLinkSrv *this, object *SelfObj, const char *Message, linkkind recipients); -int __stdcall cLinkSrv::CreateMany(cLinkSrv *this, linkkind kind, cScrStr *FromSet, cScrStr *ToSet); -int __stdcall cLinkSrv::DestroyMany(cLinkSrv *this, linkkind kind, cScrStr *FromSet, cScrStr *ToSet); +int __stdcall cLinkSrv::BroadcastOnAllLinks(cLinkSrv *this, object *SelfObj, const char *Message, linkkind recipients); // idb +int __stdcall cLinkSrv::CreateMany(cLinkSrv *this, linkkind kind, cScrStr *FromSet, cScrStr *ToSet); // idb +int __stdcall cLinkSrv::DestroyMany(cLinkSrv *this, linkkind kind, cScrStr *FromSet, cScrStr *ToSet); // idb linkset *__stdcall cLinkSrv::GetAllInherited(cLinkSrv *this, linkset *result, linkkind __$ReturnUdt, object kind, object from); // idb linkset *__stdcall cLinkSrv::GetAllInheritedSingle(cLinkSrv *this, linkset *result, linkkind __$ReturnUdt, object kind, object from); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -34346,13 +34346,13 @@ void _E14_34(); void _E13_28(); void __thiscall cLightScrSrv::~cLightScrSrv(cLightScrSrv *this); // idb void __thiscall cLightScrSrv::cLightScrSrv(cLightScrSrv *this); // idb -void __stdcall cLightScrSrv::Set(cLightScrSrv *this, object *obj, int mode, float min_brightness, float max_brightness); -void __stdcall cLightScrSrv::SetMode(cLightScrSrv *this, object *obj, int mode); -int __stdcall cLightScrSrv::GetMode(cLightScrSrv *this, object *obj); -void __stdcall cLightScrSrv::Activate(cLightScrSrv *this, object *obj); -void __stdcall cLightScrSrv::Deactivate(cLightScrSrv *this, object *obj); -void __stdcall cLightScrSrv::Subscribe(cLightScrSrv *this, object *obj); -void __stdcall cLightScrSrv::Unsubscribe(cLightScrSrv *this, object *obj); +void __stdcall cLightScrSrv::Set(cLightScrSrv *this, object *obj, int mode, float min_brightness, float max_brightness); // idb +void __stdcall cLightScrSrv::SetMode(cLightScrSrv *this, object *obj, int mode); // idb +int __stdcall cLightScrSrv::GetMode(cLightScrSrv *this, object *obj); // idb +void __stdcall cLightScrSrv::Activate(cLightScrSrv *this, object *obj); // idb +void __stdcall cLightScrSrv::Deactivate(cLightScrSrv *this, object *obj); // idb +void __stdcall cLightScrSrv::Subscribe(cLightScrSrv *this, object *obj); // idb +void __stdcall cLightScrSrv::Unsubscribe(cLightScrSrv *this, object *obj); // idb int __thiscall cLightScrSrv::GetAnimLight(cLightScrSrv *this, int obj, sAnimLightProp **pAnimLight); // idb void __thiscall cLightScrSrv::SetCore(cLightScrSrv *this, int obj, sAnimLightProp *pAnimLight, int mode, float min_brightness, float max_brightness); // idb int __thiscall cLightScrSrv::TimeLeft(cLightScrSrv *this, float current, float start, float end, int ms); // idb @@ -34379,13 +34379,13 @@ void __thiscall cNetworkingSrv::~cNetworkingSrv(cNetworkingSrv *this); // idb void __thiscall cNetworkingSrv::cNetworkingSrv(cNetworkingSrv *this); // idb void __stdcall cNetworkingSrv::Init(cNetworkingSrv *this); // idb void __stdcall cNetworkingSrv::End(cNetworkingSrv *this); // idb -int __stdcall cNetworkingSrv::Broadcast(cNetworkingSrv *this, object *scrObj, const char *pText, int sendFromProxy, const cMultiParm *data); -int __stdcall cNetworkingSrv::SendToProxy(cNetworkingSrv *this, object *toPlayer, object *obj, const char *pText, const cMultiParm *data); -int __stdcall cNetworkingSrv::TakeOver(cNetworkingSrv *this, object *obj); -int __stdcall cNetworkingSrv::GiveTo(cNetworkingSrv *this, object *obj, object *toPlayer); -int __stdcall cNetworkingSrv::IsPlayer(cNetworkingSrv *this, object *obj); +int __stdcall cNetworkingSrv::Broadcast(cNetworkingSrv *this, object *scrObj, const char *pText, int sendFromProxy, const cMultiParm *data); // idb +int __stdcall cNetworkingSrv::SendToProxy(cNetworkingSrv *this, object *toPlayer, object *obj, const char *pText, const cMultiParm *data); // idb +int __stdcall cNetworkingSrv::TakeOver(cNetworkingSrv *this, object *obj); // idb +int __stdcall cNetworkingSrv::GiveTo(cNetworkingSrv *this, object *obj, object *toPlayer); // idb +int __stdcall cNetworkingSrv::IsPlayer(cNetworkingSrv *this, object *obj); // idb int __stdcall cNetworkingSrv::IsMultiplayer(cNetworkingSrv *this); // idb -int __stdcall cNetworkingSrv::SetProxyOneShotTimer(cNetworkingSrv *this, object *toObj, const char *msg, float time, const cMultiParm *data); +int __stdcall cNetworkingSrv::SetProxyOneShotTimer(cNetworkingSrv *this, object *toObj, const char *msg, float time, const cMultiParm *data); // idb void __thiscall sScrTimerMsg::sScrTimerMsg(sScrTimerMsg *this, int to, const char *pszName, const cMultiParm *initData); // idb sScrTimerMsg *__thiscall sScrTimerMsg::`vector deleting destructor'(sScrTimerMsg *this, char __flags); void __thiscall sScrTimerMsg::~sScrTimerMsg(sScrTimerMsg *this); // idb @@ -34393,11 +34393,11 @@ object *__stdcall cNetworkingSrv::FirstPlayer(cNetworkingSrv *this, object *resu object *__stdcall cNetworkingSrv::NextPlayer(cNetworkingSrv *this, object *result); // idb int __stdcall cNetworkingSrv::Suspend(cNetworkingSrv *this); // idb int __stdcall cNetworkingSrv::Resume(cNetworkingSrv *this); // idb -int __stdcall cNetworkingSrv::HostedHere(cNetworkingSrv *this, object *obj); -int __stdcall cNetworkingSrv::IsProxy(cNetworkingSrv *this, object *obj); -int __stdcall cNetworkingSrv::LocalOnly(cNetworkingSrv *this, object *obj); +int __stdcall cNetworkingSrv::HostedHere(cNetworkingSrv *this, object *obj); // idb +int __stdcall cNetworkingSrv::IsProxy(cNetworkingSrv *this, object *obj); // idb +int __stdcall cNetworkingSrv::LocalOnly(cNetworkingSrv *this, object *obj); // idb int __stdcall cNetworkingSrv::IsNetworking(cNetworkingSrv *this); // idb -object *__stdcall cNetworkingSrv::Owner(cNetworkingSrv *this, object *result, object *__$ReturnUdt); +object *__stdcall cNetworkingSrv::Owner(cNetworkingSrv *this, object *result, object *__$ReturnUdt); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cNetworkingSrv *__thiscall cNetworkingSrv::`vector deleting destructor'(cNetworkingSrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -34442,7 +34442,7 @@ true_bool *__stdcall cObjectSrv::HasMetaProperty(cObjectSrv *this, true_bool *re true_bool *__stdcall cObjectSrv::InheritsFrom(cObjectSrv *this, true_bool *result, object __$ReturnUdt, object obj); // idb int __stdcall cObjectSrv::Teleport(cObjectSrv *this, object obj, const cScrVec *position, const cScrVec *facing, object ref_frame); // idb cScrVec *__stdcall cObjectSrv::Position(cObjectSrv *this, cScrVec *result, object __$ReturnUdt); // idb -void __thiscall cScrVec::cScrVec(cScrVec *this, cScrVec *v); +void __thiscall cScrVec::cScrVec(cScrVec *this, const mxs_vector *v); // idb cScrVec *__stdcall cObjectSrv::Facing(cObjectSrv *this, cScrVec *result, object __$ReturnUdt); // idb true_bool *__stdcall cObjectSrv::IsPositionValid(cObjectSrv *this, true_bool *result, object __$ReturnUdt); // idb object *__stdcall cObjectSrv::FindClosestObjectNamed(cObjectSrv *this, object *result, int __$ReturnUdt, const char *objId); // idb @@ -34479,7 +34479,7 @@ int __thiscall cPropertySrv::get_prop_donor(cPropertySrv *this, IProperty *prop, int __stdcall cPropertySrv::Set(cPropertySrv *this, object sobj, const char *prop, const cMultiParm *val); // idb int __stdcall cPropertySrv::Set(cPropertySrv *this, object sobj, const char *propname, const char *field, const cMultiParm *val); // idb int __stdcall cPropertySrv::SetLocal(cPropertySrv *this, object sobj, const char *propname, const char *field, const cMultiParm *val); // idb -void __thiscall cPropertySrv::SetField(cPropertySrv *this, int obj, const char *propname, const char *field, cMultiParm *val); +void __thiscall cPropertySrv::SetField(cPropertySrv *this, int obj, const char *propname, const char *field, cMultiParm *val); // idb void __thiscall cPropertySrv::SetPropField(cPropertySrv *this, IProperty *prop, int obj, const sFieldDesc *field, const cMultiParm *val); // idb int __stdcall cPropertySrv::Add(cPropertySrv *this, object sobj, const char *propname); // idb int __stdcall cPropertySrv::Remove(cPropertySrv *this, object sobj, const char *propname); // idb @@ -34507,7 +34507,7 @@ void _E15_20(); void _E14_35(); void __thiscall cPuppetSrv::~cPuppetSrv(cPuppetSrv *this); // idb void __thiscall cPuppetSrv::cPuppetSrv(cPuppetSrv *this); // idb -true_bool *__stdcall cPuppetSrv::PlayMotion(cPuppetSrv *this, true_bool *result, object __$ReturnUdt, const char *obj); +true_bool *__stdcall cPuppetSrv::PlayMotion(cPuppetSrv *this, true_bool *result, object __$ReturnUdt, const char *obj); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cPuppetSrv *__thiscall cPuppetSrv::`scalar deleting destructor'(cPuppetSrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -34574,7 +34574,7 @@ int ScriptSoundInit(); void ScriptSoundTerm(); void __cdecl ScriptSoundSave(ITagFile *file); // idb int __cdecl SndScriptRestartSavedSounds(cSoundRecord *sndDat); // idb -int __cdecl SndScrptGen(Label *lname, int iFlags, int call, int targ, int obj2, mxs_vector *crd, cTagSet *pTags, int amb, eEnvSoundLoc loc, eSndPlayType play, eSoundNetwork net); // idb +int __cdecl SndScrptGen(Label *lname, unsigned int iFlags, int call, int targ, int obj2, mxs_vector *crd, cTagSet *pTags, int amb, eEnvSoundLoc loc, eSndPlayType play, eSoundNetwork net); void __cdecl SchemaParamsSetup(sSchemaCallParams *pParams, int SourceObjID, mxs_vector *Coordinates, unsigned int iFlags, eSoundNetwork net); // idb void __cdecl SndScriptSendSavedMsg(cSoundRecord *sndDat); // idb int _E24_5(); @@ -34586,7 +34586,7 @@ int ScriptSoundPostLoad(); int ScriptSoundEnterModeHack(); int ScriptSoundReset(); void __cdecl ActiveSchemaDoneCallback(int iHandle, int iSchemaID); -void __cdecl SFXParamsSetup(sfx_parm *pParams, int iFlags, eSoundNetwork net); // idb +void __cdecl SFXParamsSetup(sfx_parm *pParams, unsigned int iFlags, eSoundNetwork net); void __cdecl ActiveSoundDoneCallback(int iHandle); sPersistent *__cdecl g_PersistFactorysSoundDoneMsg(); // idb void _E27_1(); @@ -34603,8 +34603,8 @@ void _E32_0(); int _E34_2(); void __cdecl _E33_1(); // idb unsigned __int8 __cdecl PlayAndRememberSound(const char *SoundName, int CallObjID, int TargObjID, mxs_vector *pCoord, int bAmbient, eSoundSpecial Special, eSoundNetwork Network); // idb -unsigned __int8 __cdecl PlayAndRememberSchema(int SchemaID, int CallObjID, int TargObjID, mxs_vector *pCoord, int iFlags, eSoundNetwork Network); -unsigned __int8 __cdecl PlayAndRememberEnvSchema(int CallObjID, int SrcObjID, int Obj2, cTagSet *pTagSet, mxs_vector *pCoord, int iFlags, eEnvSoundLoc loc, eSoundNetwork Network); +unsigned __int8 __cdecl PlayAndRememberSchema(int SchemaID, int CallObjID, int TargObjID, mxs_vector *pCoord, unsigned int iFlags, eSoundNetwork Network); // idb +unsigned __int8 __cdecl PlayAndRememberEnvSchema(int CallObjID, int SrcObjID, int Obj2, cTagSet *pTagSet, mxs_vector *pCoord, unsigned int iFlags, eEnvSoundLoc loc, eSoundNetwork Network); // idb int __cdecl HaltActiveSounds(int TargetObjID, const char *pszName, int CallbackObjID, int bIsSchema); // idb void _E38_0(); void _E37_0(); @@ -34622,21 +34622,21 @@ BOOL __thiscall sPersistent::Persistent(sPersistent *this, cScrVec *v); void __thiscall sSchemaDoneMsg::sSchemaDoneMsg(sSchemaDoneMsg *this); // idb void __thiscall cSoundScrSrv::~cSoundScrSrv(cSoundScrSrv *this); // idb void __thiscall cSoundScrSrv::cSoundScrSrv(cSoundScrSrv *this); // idb -true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, eSoundSpecial SoundName, eSoundNetwork Special); +true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, eSoundSpecial SoundName, eSoundNetwork Special); // idb void __thiscall cSoundRecord::cSoundRecord(cSoundRecord *this, int iHandle, mxs_vector *pCoordinates, int CallbackObjID, int TargetObjID, Label *Name, int bIsSchema); // idb -true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, object SoundName, eSoundSpecial TargetObj, eSoundNetwork Special); -true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, cScrVec *SoundName, eSoundSpecial Location, eSoundNetwork Special); -true_bool *__stdcall cSoundScrSrv::PlayAmbient(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, eSoundSpecial SoundName, eSoundNetwork Special); +true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, object SoundName, eSoundSpecial TargetObj, eSoundNetwork Special); // idb +true_bool *__stdcall cSoundScrSrv::Play(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, cScrVec *SoundName, eSoundSpecial Location, eSoundNetwork Special); // idb +true_bool *__stdcall cSoundScrSrv::PlayAmbient(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObjID, eSoundSpecial SoundName, eSoundNetwork Special); // idb true_bool *__stdcall cSoundScrSrv::PlaySchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, object CallbackObjID, eSoundNetwork Schema); // idb true_bool *__stdcall cSoundScrSrv::PlaySchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, object CallbackObjID, object Schema, eSoundNetwork TargetObj); // idb true_bool *__stdcall cSoundScrSrv::PlaySchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, object CallbackObjID, cScrVec *Schema, eSoundNetwork Location); // idb true_bool *__stdcall cSoundScrSrv::PlaySchemaAmbient(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, object CallbackObjID, eSoundNetwork Schema); // idb -true_bool *__stdcall cSoundScrSrv::PlayEnvSchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObject, object Tags, object SourceObject, eEnvSoundLoc Agent, eSoundNetwork loc); +true_bool *__stdcall cSoundScrSrv::PlayEnvSchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *CallbackObject, object Tags, object SourceObject, eEnvSoundLoc Agent, eSoundNetwork loc); // idb true_bool *__stdcall cSoundScrSrv::PlayVoiceOver(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, object cb_obj); // idb -int __stdcall cSoundScrSrv::Halt(cSoundScrSrv *this, object TargetObject, cScrStr *SoundName, object CallbackObject); -true_bool *__stdcall cSoundScrSrv::HaltSchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *TargetObject, object SchemaName); +int __stdcall cSoundScrSrv::Halt(cSoundScrSrv *this, object TargetObject, cScrStr *SoundName, object CallbackObject); // idb +true_bool *__stdcall cSoundScrSrv::HaltSchema(cSoundScrSrv *this, true_bool *result, object __$ReturnUdt, cScrStr *TargetObject, object SchemaName); // idb int __stdcall cSoundScrSrv::HaltSpeech(cSoundScrSrv *this, object speakerObj); // idb -true_bool *__stdcall cSoundScrSrv::PreLoad(cSoundScrSrv *this, true_bool *result, cScrStr *__$ReturnUdt); +true_bool *__stdcall cSoundScrSrv::PreLoad(cSoundScrSrv *this, true_bool *result, cScrStr *__$ReturnUdt); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cSoundScrSrv *__thiscall cSoundScrSrv::`vector deleting destructor'(cSoundScrSrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -34680,7 +34680,7 @@ void __thiscall cRoom::cRoom(cRoom *this, const cAnsiStr *name, int objID, tPlan void __thiscall cRoom::cRoom(cRoom *this, void (__cdecl *movefunc)(void *, unsigned int, unsigned int)); // idb void __thiscall cRoom::~cRoom(cRoom *this); // idb void __thiscall cRoom::Write(cRoom *this, void (__cdecl *movefunc)(void *, unsigned int, unsigned int)); // idb -const mxs_vector *__thiscall cRoom::GetSize(cRoom *this, mxs_vector *result); +const mxs_vector *__thiscall cRoom::GetSize(cRoom *this, mxs_vector *result); // idb void __thiscall cRoom::AddPortal(cRoom *this, cRoomPortal *newPortal); // idb BOOL __thiscall cRoom::PointInside(cRoom *this, const mxs_vector *pt); BOOL __thiscall cRoom::LineIntersect(cRoom *this, const mxs_vector *from, const mxs_vector *to); @@ -34811,10 +34811,10 @@ void __cdecl cleanup_tagfile_4(ITagFile *file); // idb void install_obj_message(); void __cdecl obj_message_2(int obj, unsigned int msg); void __thiscall cRoomPropAgent::~cRoomPropAgent(cRoomPropAgent *this); // idb -void __thiscall cRoomPropAgent::PropagateBF(cRoomPropAgent *this, const mxs_vector *startPos, cRoom *startRoom); -void __thiscall cRoomPropAgent::PropagateRec(cRoomPropAgent *this, cRoom *curRoom, cRoomPortal *enterPortal, const mxs_vector *enterPt, float dist, int depth); +void __thiscall cRoomPropAgent::PropagateBF(cRoomPropAgent *this, const mxs_vector *startPos, cRoom *startRoom); // idb +void __thiscall cRoomPropAgent::PropagateRec(cRoomPropAgent *this, cRoom *curRoom, cRoomPortal *enterPortal, const mxs_vector *enterPt, float dist, int depth); // idb void __thiscall cRoomPropAgent::PropagateDF(cRoomPropAgent *this, const mxs_vector *startPos, const cRoom *startRoom); // idb -void __thiscall cRoomPropAgent::GetRoomPath(cRoomPropAgent *this, cRoom *endRoom, cRoomPropResultList *pResultList); +void __thiscall cRoomPropAgent::GetRoomPath(cRoomPropAgent *this, cRoom *endRoom, cRoomPropResultList *pResultList); // idb double __thiscall cRoom::GetPortalDist(cRoom *this, unsigned int portalOne, unsigned int portalTwo); void __thiscall cBFRoomInfo::Init(cBFRoomInfo *this, float _dist, __int16 _previous_room, __int16 _previous_portal, __int16 _next_active, __int16 _prev_active); double __thiscall cBFRoomInfo::GetDist(cBFRoomInfo *this); @@ -35265,7 +35265,7 @@ void __thiscall cPropSndInst::DrawActiveSounds(cPropSndInst *this); // idb void __thiscall cPropSndInst::SpewActiveSounds(cPropSndInst *this); // idb void __thiscall cPropSndInst::BackCastPath(cPropSndInst *this, sAnchorPt *anchor_list, cRoomPortal **portal_list, int i, const mxs_vector *L, const mxs_vector *src_pt); // idb void __thiscall cPropSndInst::FindSoundPath(cPropSndInst *this, const mxs_vector *src_pt, const mxs_vector *hear_pt, const cBFRoomInfo *room_table, int end_room, float *dist, mxs_vector *position, float *realDist, float *blockingFactor); // idb -int __thiscall cPropSndInstHigh::EnterCallback(cPropSndInstHigh *this, cRoom *room, const cRoomPortal *enterPortal, const mxs_vector *enterPt, float dist); +int __thiscall cPropSndInstHigh::EnterCallback(cPropSndInstHigh *this, cRoom *room, const cRoomPortal *enterPortal, const mxs_vector *enterPt, float dist); // idb void __thiscall cPropSndInstHigh::ExitCallback(cPropSndInstHigh *this, const cRoom *room); // idb double __thiscall cPropSndInstHigh::PortalsCallback(cPropSndInstHigh *this, const cRoomPortal *enterPortal, cRoomPortal *exitPortal, float dist); void __thiscall cRoomPAFuncs::cRoomPAFuncs(cRoomPAFuncs *this); // idb @@ -36189,10 +36189,10 @@ int __stdcall cDataOpsTagFile::Write(cDataOpsTagFile *this, const char *buf, int int __stdcall cDataOpsTagFile::Seek(cDataOpsTagFile *this, eDataOpSeek seek, unsigned int where); // idb unsigned int __stdcall cDataOpsTagFile::Tell(cDataOpsTagFile *this); // idb void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this); // idb -void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this, const void *buf, int len); // idb +void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this, const void *buf, unsigned int len); void __thiscall cDataOpsMemFile::~cDataOpsMemFile(cDataOpsMemFile *this); // idb size_t __stdcall cDataOpsMemFile::Read(cDataOpsMemFile *this, void *buf, unsigned int len); -int __stdcall cDataOpsMemFile::Write(cDataOpsMemFile *this, const void *buf, int len); // idb +size_t __stdcall cDataOpsMemFile::Write(cDataOpsMemFile *this, const void *buf, size_t len); int __stdcall cDataOpsMemFile::Seek(cDataOpsMemFile *this, eDataOpSeek seek, unsigned int where); // idb unsigned int __stdcall cDataOpsMemFile::Tell(cDataOpsMemFile *this); // idb char *__stdcall cDataOpsMemFile::GetBuffer(cDataOpsMemFile *this); @@ -36494,7 +36494,7 @@ int __stdcall cLinkManager::RemoveRelation(cLinkManager *this, __int16 id); // i BOOL __stdcall cLinkManager::AddQueryDB(cLinkManager *this, ILinkQueryDatabase *db, unsigned int cases); int __cdecl AddQDBToList(ILinkQueryDatabase *db, cDynArray *QueryDBs); // idb BOOL __stdcall cLinkManager::RemoveQueryDB(cLinkManager *this, ILinkQueryDatabase *db, unsigned int cases); -int __cdecl RemoveQDBFromList(ILinkQueryDatabase *db, cDynArray *QueryDBs); // idb +BOOL __cdecl RemoveQDBFromList(ILinkQueryDatabase *db, cDynArray *QueryDBs); int __stdcall cLinkManager::Lock(cLinkManager *this); // idb int __stdcall cLinkManager::Unlock(cLinkManager *this, int __formal); // idb unsigned int __stdcall cLinkManager::GetLockCount(cLinkManager *this); @@ -36667,11 +36667,11 @@ void _E2_20(); int __stdcall cBaseLinkStore::QueryInterface(cBaseLinkStore *this, const _GUID *id, void **ppI); // idb unsigned int __stdcall cBaseLinkStore::AddRef(cBaseLinkStore *this); // idb unsigned int __stdcall cBaseLinkStore::Release(cBaseLinkStore *this); // idb -// int __userpurge cBaseLinkStore::Save@(int a1@, cBaseLinkStore *this, __int16 id, IUnknown *fileunk, int partition); +// int __userpurge cBaseLinkStore::Save@(int a1@, cBaseLinkStore *this, __int16 id, IUnknown *fileunk, unsigned int partition); BOOL __cdecl IsLinkSavePartition(int id, int src, int dest, unsigned int partition); int __cdecl setup_file_0(IRelation *rel, ITagFile *file, const char *prefix, VersionNum *ver); // idb void __cdecl cleanup_file_0(ITagFile *file); // idb -// int __userpurge cBaseLinkStore::Load@(int a1@, cBaseLinkStore *this, __int16 id, IUnknown *fileunk, int partition); +// int __userpurge cBaseLinkStore::Load@(int a1@, cBaseLinkStore *this, __int16 id, IUnknown *fileunk, unsigned int partition); int __stdcall cBaseLinkStore::Reset(cBaseLinkStore *this, __int16 id); // idb int __stdcall cBaseLinkDataStore::QueryInterface(cBaseLinkDataStore *this, const _GUID *id, void **ppI); // idb unsigned int __stdcall cBaseLinkDataStore::AddRef(cBaseLinkDataStore *this); // idb @@ -36679,7 +36679,7 @@ unsigned int __stdcall cBaseLinkDataStore::Release(cBaseLinkDataStore *this); // int __stdcall cBaseLinkDataStore::Add(cBaseLinkDataStore *this, int __formal); // idb int __stdcall cBaseLinkDataStore::Remove(cBaseLinkDataStore *this, int __formal); // idb int __stdcall cBaseLinkDataStore::AddRelation(cBaseLinkDataStore *this, __int16 __formal); // idb -// int __userpurge cBaseLinkDataStore::Save@(int a1@, cBaseLinkDataStore *this, __int16 id, IUnknown *fileunk, int filetype); +// int __userpurge cBaseLinkDataStore::Save@(int a1@, cBaseLinkDataStore *this, __int16 id, IUnknown *fileunk, unsigned int filetype); // int __userpurge cBaseLinkDataStore::Load@(int a1@, cBaseLinkDataStore *this, __int16 id, IUnknown *fileunk, int filetype); // int __userpurge cBaseLinkDataStore::Reset@(int a1@, cBaseLinkDataStore *this, __int16 id); cLinkMap *ClearLinkMappingTable(); @@ -36856,11 +36856,11 @@ cBaseRelation *__stdcall cBaseRelation::Inverse(cBaseRelation *this); int __stdcall cBaseRelation::Listen(cBaseRelation *this, unsigned int interests, void (__stdcall *func)(sRelationListenMsg *, void *), void *data); // idb void __thiscall cBaseRelation::CallListeners(cBaseRelation *this, unsigned int msg, int id, sLink *linkdata); // idb int __stdcall cBaseRelation::GetSingleLink(cBaseRelation *this, int source, int dest); // idb -int __stdcall cBaseRelation::AnyLinks(cBaseRelation *this, int source, int dest); // idb +BOOL __stdcall cBaseRelation::AnyLinks(cBaseRelation *this, int source, int dest); void __thiscall cLinkQueryDatabaseSet::Init(cLinkQueryDatabaseSet *this); // idb void __thiscall cLinkQueryDatabaseSet::~cLinkQueryDatabaseSet(cLinkQueryDatabaseSet *this); // idb void __thiscall cLinkQueryDatabaseSet::cLinkQueryDatabaseSet(cLinkQueryDatabaseSet *this, ILinkQueryDatabase *none, ILinkQueryDatabase *src, ILinkQueryDatabase *dst, ILinkQueryDatabase *both); // idb -void __thiscall cLinkQueryDatabaseSet::cLinkQueryDatabaseSet(cLinkQueryDatabaseSet *this, cLinkQueryDatabaseSet *set); +void __thiscall cLinkQueryDatabaseSet::cLinkQueryDatabaseSet(cLinkQueryDatabaseSet *this, cLinkQueryDatabaseSet *set); // idb void __thiscall cLinkQueryDatabaseSet::cLinkQueryDatabaseSet(cLinkQueryDatabaseSet *this, IUnknown *db); // idb void __thiscall cStandardRelation::Init(cStandardRelation *this); // idb void __thiscall cStandardRelation::cStandardRelation(cStandardRelation *this, const sRelationDesc *desc, const sRelationDataDesc *ddesc, IUnknown *store, IUnknown *db, IUnknown *datastor); // idb @@ -36874,7 +36874,7 @@ int __stdcall cStandardRelation::Get(cStandardRelation *this, int id, sLink *out int __stdcall cStandardRelation::SetData(cStandardRelation *this, int id, void *data); // idb void *__stdcall cStandardRelation::GetData(cStandardRelation *this, int id); // idb // ILinkQuery *__userpurge cStandardRelation::Query@(int a1@, cStandardRelation *this, int source, int dest); -int __stdcall cStandardRelation::Notify(cStandardRelation *this, int msg, void *data); +int __stdcall cStandardRelation::Notify(cStandardRelation *this, unsigned int msg, void *data); // idb void __thiscall cStandardRelation::SendLinkMsg(cStandardRelation *this, unsigned int ops, int id, sLink *linkdata); // idb void __cdecl cStandardRelation::ReceiveLinkMsg(sLinkNetMsg *pMsg, unsigned int size, int from); IRelation *__cdecl CreateRelationFromLinkStore(const sRelationDesc *desc, const sRelationDataDesc *datadesc, ILinkStore *store, unsigned int optimize); // idb @@ -37488,9 +37488,9 @@ void _E7_28(); void _E6_23(); void __thiscall cStoredProperty::write_obj(cStoredProperty *this, int obj, IDataOpsFile *file, unsigned int __formal); // idb void __thiscall cStoredProperty::Save(cStoredProperty *this, ITagFile *file, unsigned int partition); // idb -int __cdecl setup_file_1(const sPropertyDesc *desc, ITagFile *file, unsigned int *version); // idb +BOOL __cdecl setup_file_1(const sPropertyDesc *desc, ITagFile *file, unsigned int *version); void __cdecl cleanup_file_1(ITagFile *file); // idb -void __thiscall cStoredProperty::read_obj(cStoredProperty *this, IDataOpsFile *file, unsigned int partition, int version); +void __thiscall cStoredProperty::read_obj(cStoredProperty *this, IDataOpsFile *file, unsigned int partition, unsigned int version); // idb void __thiscall cStoredProperty::Load(cStoredProperty *this, ITagFile *file, unsigned int partition); // idb int _E12_24(); void _E8_43(); @@ -37779,7 +37779,7 @@ void __thiscall cDynArray::cDynArray(cDynArray::cIPtr(cIPtr *this, ITrait *pUnknownInit); // idb void __thiscall cDynArray_::cDynArray_(cDynArray_ *this, int size); // idb cSimpleDListNode *__thiscall cDList,1>::GetFirst(cDList,1> *this); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb sStackFrame *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); unsigned int __thiscall cDABase>::Grow(cDABase > *this, unsigned int num); // idb @@ -37811,7 +37811,7 @@ void __thiscall cClosureQuery::~cClosureQuery(cClosureQuery *this); // idb void __thiscall cSimpleStack::cSimpleStack(cSimpleStack *this); // idb void __thiscall cDynArray::cDynArray(cDynArray *this, int size); // idb void __thiscall cDynArray_::cDynArray_(cDynArray_ *this, int size); // idb -void __thiscall cDABase>::cDABase>(cDABase > *this, int size); // idb +void __thiscall cDABase>::cDABase>(cDABase > *this, unsigned int size); void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb cMetaPropLinks *__cdecl GetObjectMetaPropLinks(int obj); IRelation *InitTraitRelations(); @@ -38023,7 +38023,7 @@ void __thiscall cDynArray_::~cDynArray_::cDListNode(cDListNode *this); // idb void __thiscall cDListNode::cDListNode(cDListNode *this); // idb -void __thiscall cDonorTable::Clear(cDonorTable *this, int size); // idb +void __thiscall cDonorTable::Clear(cDonorTable *this, unsigned int size); void __thiscall cDList::cDList(cDList *this); // idb void __thiscall cHashSet::cHashSet(cHashSet *this, unsigned int n); // idb void __thiscall cDynArray::cDynArray(cDynArray *this); // idb @@ -38036,8 +38036,8 @@ tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, sCacheKey *key); tHashSetNode__ *__thiscall cHashSet::Remove(cHashSet *this, cDonorCacheEntry *node); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb -int __thiscall cHashSet::IsEqual(cHashSet *this, sCacheKey *k1, sCacheKey *k2); -int __cdecl cCacheKeyHashFns::IsEqual(sCacheKey *p1, const sCacheKey *p2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb +int __cdecl cCacheKeyHashFns::IsEqual(sCacheKey *p1, const sCacheKey *p2); // idb BOOL __thiscall sCacheKey::operator==(sCacheKey *this, const sCacheKey *other); unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb unsigned int __cdecl cCacheKeyHashFns::Hash(const sCacheKey *p); // idb @@ -38149,7 +38149,7 @@ cPhysTerrPoly *__thiscall cPhysClsn::GetTerrainPoly(cPhysClsn *this, int index); int __thiscall cPhysClsn::GetCellID(cPhysClsn *this, int index); // idb int __thiscall cPhysClsn::GetPolyID(cPhysClsn *this, int index); // idb int __thiscall cPhysClsn::GetTexture(cPhysClsn *this); // idb -const mxs_vector *__thiscall cPhysClsn::GetNormal(cPhysClsn *this, mxs_vector *result, int __$ReturnUdt); +const mxs_vector *__thiscall cPhysClsn::GetNormal(cPhysClsn *this, mxs_vector *result, int __$ReturnUdt); // idb void __thiscall cPhysClsn::GenerateClsnPt(cPhysClsn *this); // idb void __thiscall cPhysClsns::Insert(cPhysClsns *this, cPhysClsn *pNewClsn); // idb void __thiscall cPhysClsns::Sort(cPhysClsns *this); // idb @@ -38158,7 +38158,7 @@ void __thiscall cPhysTerrPoly::cPhysTerrPoly(cPhysTerrPoly *this, cPhysTerrPoly void __thiscall cDListNode::cDListNode(cDListNode *this); // idb void __thiscall cPhysTerrVertex::cPhysTerrVertex(cPhysTerrVertex *this, cPhysTerrVertex *pTerrVertex); // idb void __thiscall cPhysTerrPoly::cPhysTerrPoly(cPhysTerrPoly *this, int cellID, int polyID); // idb -void __cdecl InitSubModelInstance(sPhysSubModInst *pInstance, int subModId, cPhysModel *pModel, const mxs_vector *locVec); +void __cdecl InitSubModelInstance(sPhysSubModInst *pInstance, int subModId, cPhysModel *pModel, const mxs_vector *locVec); // idb double __thiscall cPhysClsn::GetT0(cPhysClsn *this); double __thiscall cPhysClsn::GetDT(cPhysClsn *this); const mxs_vector *__thiscall cPhysClsn::GetLoc(cPhysClsn *this); // idb @@ -38201,7 +38201,7 @@ void __thiscall cFaceContact::cFaceContact(cFaceContact *this, cPhysOBBModel *pM void __thiscall cFaceContact::cFaceContact(cFaceContact *this, cPhysSphereModel *pModel, float radius, int endLoc); // idb mxs_vector *__thiscall cEdgeContact::GetNormal(cEdgeContact *this, mxs_vector *result, const mxs_vector *__$ReturnUdt); // idb double __thiscall cEdgeContact::GetDist(cEdgeContact *this, const mxs_vector *pt); -const mxs_vector *__thiscall cVertexContact::GetNormal(cVertexContact *this, mxs_vector *result, const mxs_vector *__$ReturnUdt); +const mxs_vector *__thiscall cVertexContact::GetNormal(cVertexContact *this, mxs_vector *result, const mxs_vector *__$ReturnUdt); // idb BOOL __thiscall cFaceContactList::Find(cFaceContactList *this, const cFacePoly *poly, cDListNode **ppFaceContact); BOOL __thiscall cEdgeContactList::Find(cEdgeContactList *this, const mxs_vector *start, const mxs_vector *end, cDListNode **ppEdgeContact); BOOL __thiscall cVertexContactList::Find(cVertexContactList *this, const mxs_vector *point, cDListNode **ppVertexContact); @@ -38461,10 +38461,10 @@ int __cdecl CheckStep(cPhysClsn *pClsn, int coll_OBB); // idb void __cdecl ResolveBounce(cPhysClsn *pClsn, float dt); // idb void __cdecl BounceObject(cPhysDynData *pDynamics, const mxs_vector *normal, float elasticity); // idb void __cdecl BounceObjectTorque(cPhysDynData *pDynamics, const mxs_vector *normal, const mxs_vector *relVel); // idb -int __cdecl CheckTerrainContact(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cFaceContact *pFaceContact); -int __cdecl CheckTerrainContact_0(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cEdgeContact *pEdgeContact); -int __cdecl CheckTerrainContact_1(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cVertexContact *pVertexContact); -void __cdecl CheckSpheresContact(cPhysSphereModel *pModel1, int subModId1, cPhysDynData *pDynamics1, cPhysSphereModel *pModel2, int subModId2, cPhysDynData *pDynamics2); +int __cdecl CheckTerrainContact(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cFaceContact *pFaceContact); // idb +int __cdecl CheckTerrainContact_0(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cEdgeContact *pEdgeContact); // idb +int __cdecl CheckTerrainContact_1(cPhysModel *pModel, int subModId, cPhysDynData *pDynamics, cVertexContact *pVertexContact); // idb +void __cdecl CheckSpheresContact(cPhysSphereModel *pModel1, int subModId1, cPhysDynData *pDynamics1, cPhysSphereModel *pModel2, int subModId2, cPhysDynData *pDynamics2); // idb void __cdecl CheckSphereOBBContact(cPhysSphereModel *pSphereModel, int subModId, cPhysModel *pOBBModel, int side, cFaceContact *pFaceContact); // idb void __cdecl ZeroAcceleration(cPhysModel *pModel); // idb void __cdecl StartFrame(float dt); // idb @@ -38625,7 +38625,7 @@ int __thiscall cPhysListeners::CreateListener(cPhysListeners *this, const char * void __thiscall cPhysListeners::DestroyListener(cPhysListeners *this, int handle); // idb void __thiscall cPhysListeners::Listen(cPhysListeners *this, int handle, int objID); // idb void __thiscall cPhysListeners::Unlisten(cPhysListeners *this, int handle, int objID); // idb -int __thiscall cPhysListeners::HasListener(cPhysListeners *this, int objID, int type); +int __thiscall cPhysListeners::HasListener(cPhysListeners *this, int objID, ePhysScriptMsgType_ type); // idb void __thiscall cPhysListeners::CallCollision(cPhysListeners *this, int objID, int submod, int type, int coll_object, int coll_submod, const mxs_vector *normal, float momentum, const mxs_vector *pt); // idb void __thiscall cPhysListeners::Read(cPhysListeners *this, void (__cdecl *readFunc)(void *, unsigned int, unsigned int)); // idb void __thiscall cPhysListeners::Write(cPhysListeners *this, void (__cdecl *writeFunc)(void *, unsigned int, unsigned int)); // idb @@ -38685,7 +38685,7 @@ void __thiscall cPhysModel::SetCurrentLocationVec(cPhysModel *this, int subModId void __thiscall cPhysModel::SetLocationVec(cPhysModel *this, const mxs_vector *locVec, int update); // idb void __thiscall cPhysModel::SetCurrentLocationVec(cPhysModel *this, const mxs_vector *locVec, int update); // idb void __thiscall cPhysModel::SetRotation(cPhysModel *this, const mxs_angvec *rot, int update); // idb -const mxs_vector *__thiscall cPhysModel::GetCOG(cPhysModel *this, mxs_vector *result); +const mxs_vector *__thiscall cPhysModel::GetCOG(cPhysModel *this, mxs_vector *result); // idb void __thiscall cPhysModel::AddConstraint(cPhysModel *this, int cause, const mxs_vector *dir, float mag); // idb void __thiscall cPhysModel::AddConstraint(cPhysModel *this, int cause, const mxs_vector *norm); // idb void __thiscall cPhysModel::AddConstraint(cPhysModel *this, int cause, int i, const mxs_vector *norm); // idb @@ -38700,7 +38700,7 @@ int __thiscall cPhysModel::IsRotationalVelocityControlled(cPhysModel *this); // int __thiscall cPhysModel::IsLocationControlled(cPhysModel *this); // idb int __thiscall cPhysModel::IsRotationControlled(cPhysModel *this); // idb void __thiscall cPhysModel::SetSleep(cPhysModel *this, int state); // idb -int __thiscall cPhysModel::IsTranslating(cPhysModel *this); // idb +BOOL __thiscall cPhysModel::IsTranslating(cPhysModel *this); void __thiscall cPhysModel::CreateTerrainContact(cPhysModel *this, int subModId, const cFacePoly *poly, int objID); // idb void __thiscall cPhysModel::CreateTerrainContact(cPhysModel *this, int subModId, const mxs_vector *start, const mxs_vector *end); // idb void __thiscall cPhysModel::CreateTerrainContact(cPhysModel *this, int subModId, const mxs_vector *point); // idb @@ -39949,7 +39949,7 @@ int _E6_25(); void __cdecl _E5_21(); // idb void **__cdecl PhysRefListFunc(int *bin); void __cdecl PhysRefListClearFunc(int *bin); -void __cdecl PhysBinUpdateFunc(int obj, int refsys, _DWORD *binmem, int num_bins); +void __cdecl PhysBinUpdateFunc(int obj, unsigned int refsys, _DWORD *binmem, int num_bins); void __cdecl PhysBinUpdateFuncDummy(); void __cdecl PhysBinPrintFunc(_DWORD *bin, char *str, int maxstrlen); int __cdecl PhysBinComputeFuncDummy(); @@ -40001,7 +40001,7 @@ void __stdcall cPhysSrv::End(cPhysSrv *this); // idb int __stdcall cPhysSrv::SubscribeMsg(cPhysSrv *this, object phys_obj, int message_types); // idb int __stdcall cPhysSrv::UnsubscribeMsg(cPhysSrv *this, object phys_obj, int message_types); // idb object *__stdcall cPhysSrv::LaunchProjectile(cPhysSrv *this, object *result, object __$ReturnUdt, object launcher, float proj, int power, const cScrVec *flags); // idb -int __stdcall cPhysSrv::SetVelocity(cPhysSrv *this, object obj, cScrVec *vel); +int __stdcall cPhysSrv::SetVelocity(cPhysSrv *this, object obj, const cScrVec *vel); // idb int __stdcall cPhysSrv::GetVelocity(cPhysSrv *this, object obj, cScrVec *vel); // idb int __stdcall cPhysSrv::SetGravity(cPhysSrv *this, object obj, float gravity); // idb float __stdcall cPhysSrv::GetGravity(cPhysSrv *this, object obj); // idb @@ -40011,12 +40011,12 @@ BOOL __stdcall cPhysSrv::IsOBB(cPhysSrv *this, object obj); int __stdcall cPhysSrv::ControlCurrentLocation(cPhysSrv *this, object obj); // idb int __stdcall cPhysSrv::ControlCurrentRotation(cPhysSrv *this, object obj); // idb int __stdcall cPhysSrv::ControlCurrentPosition(cPhysSrv *this, object obj); // idb -int __stdcall cPhysSrv::ControlVelocity(cPhysSrv *this, object obj, cScrVec *vel); +int __stdcall cPhysSrv::ControlVelocity(cPhysSrv *this, object obj, const cScrVec *vel); // idb int __stdcall cPhysSrv::StopControlVelocity(cPhysSrv *this, object obj); // idb int __stdcall cPhysSrv::DeregisterModel(cPhysSrv *this, object obj); // idb void __stdcall cPhysSrv::PlayerMotionSetOffset(cPhysSrv *this, __int16 subModel, cScrVec *offset); -int __stdcall cPhysSrv::Activate(cPhysSrv *this, object obj); -int __stdcall cPhysSrv::ValidPos(cPhysSrv *this, object obj); +int __stdcall cPhysSrv::Activate(cPhysSrv *this, object obj); // idb +int __stdcall cPhysSrv::ValidPos(cPhysSrv *this, object obj); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cPhysSrv *__thiscall cPhysSrv::`scalar deleting destructor'(cPhysSrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -40136,7 +40136,7 @@ int __cdecl PhysObjValidPos(int objID, mxs_vector *delta); // idb int __cdecl PhysSphereIntersectsDoor(int objID); // idb int __cdecl PhysObjOnGround(int objID); // idb int __cdecl PhysObjOnPlatform(int objID); // idb -void __cdecl PhysSetFlag(int objID, int flag, int state); // idb +void __cdecl PhysSetFlag(int objID, unsigned int flag, int state); int __cdecl PhysGetObjMediaState(int objID); BOOL __cdecl PhysObjInWater(int objID); void __cdecl PhysObjGetFlow(int objID, mxs_vector *flow); // idb @@ -40233,7 +40233,7 @@ void PhysicsJoyride(); void __cdecl PhysicsSetControl(float speed); // idb void PhysicsStopControl(); void __cdecl PhysicsDebugObj(int objID); // idb -void __cdecl PhysicsDebug(int what); // idb +void __cdecl PhysicsDebug(unsigned int what); void __thiscall cPhysicsDebug::SetDebugObj(cPhysicsDebug *this, int objID, unsigned int flags); // idb void __thiscall cPhysicsDebug::SetDebugAll(cPhysicsDebug *this, unsigned int flags); // idb __int16 __thiscall cHashTable>::Insert(cHashTable > *this, const int *key, unsigned int *value); @@ -40337,7 +40337,7 @@ void _E13_36(); void _E12_28(); cMotionPlan *__thiscall cCombatManeuverFactory::CreatePlan(cCombatManeuverFactory *this, const cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); // idb cCombatManeuver *__thiscall cCombatManeuverFactory::LoadManeuver(cCombatManeuverFactory *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile); -void __thiscall cCombatManeuver::cCombatManeuver(cCombatManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const sMcMoveParams *pParams, const mxs_angvec *pDirection, int doDir); +void __thiscall cCombatManeuver::cCombatManeuver(cCombatManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const sMcMoveParams *pParams, const mxs_angvec *pDirection, int doDir); // idb void __thiscall cCombatManeuver::cCombatManeuver(cCombatManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile, int *success); // idb void __thiscall cCombatManeuver::Save(cCombatManeuver *this, ITagFile *pTagFile); // idb void __thiscall cCombatManeuver::~cCombatManeuver(cCombatManeuver *this); // idb @@ -40407,7 +40407,7 @@ unsigned int __thiscall cHashSet::Hash void _E7_32(); void _E6_26(); cMotionPlan *__thiscall cFlexBowManeuverFactory::CreatePlan(cFlexBowManeuverFactory *this, const cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); // idb -void __thiscall cFlexBowManeuver::cFlexBowManeuver(cFlexBowManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const sMcMoveParams *params); +void __thiscall cFlexBowManeuver::cFlexBowManeuver(cFlexBowManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const sMcMoveParams *params); // idb void __thiscall cFlexBowManeuver::~cFlexBowManeuver(cFlexBowManeuver *this); // idb void __thiscall cFlexBowManeuver::GetExpectedEndMoveState(cFlexBowManeuver *this, sMcMoveState *moveState); // idb void __thiscall cFlexBowManeuver::Execute(cFlexBowManeuver *this); // idb @@ -40421,12 +40421,12 @@ void __thiscall cFlexBowManeuver::NotifyAboutBeingStuck(cFlexBowManeuver *this); cFlexBowManeuver *__thiscall cFlexBowManeuver::`scalar deleting destructor'(cFlexBowManeuver *this, char __flags); void _E7_33(); void _E6_27(); -cMotionPlan *__thiscall cGroundActionManeuverFactory::CreatePlan(cGroundActionManeuverFactory *this, cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); +cMotionPlan *__thiscall cGroundActionManeuverFactory::CreatePlan(cGroundActionManeuverFactory *this, const cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); // idb cGroundActionManeuver *__thiscall cGroundActionManeuverFactory::LoadManeuver(cGroundActionManeuverFactory *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile); -void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema); +void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema); // idb void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, char *name); void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, int motionNum, int dummy); -void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const mxs_angvec *direction); +void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const mxs_angvec *direction); // idb void __thiscall cGroundActionManeuver::cGroundActionManeuver(cGroundActionManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile, int *success); // idb void __thiscall cGroundActionManeuver::~cGroundActionManeuver(cGroundActionManeuver *this); // idb void __thiscall cGroundActionManeuver::GetExpectedEndMoveState(cGroundActionManeuver *this, sMcMoveState *moveState); // idb @@ -40447,7 +40447,7 @@ cMotionPlan *__thiscall cGroundLocoManeuverFactory::CreatePlan(cGroundLocoManeuv cGroundLocoManeuver *__thiscall cGroundLocoManeuverFactory::LoadManeuver(cGroundLocoManeuverFactory *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile); void __thiscall cGroundLocoManeuver::cGroundLocoManeuver(cGroundLocoManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile, int *success); // idb void __thiscall cGroundLocoManeuver::Save(cGroundLocoManeuver *this, ITagFile *pTagFile); // idb -void __thiscall cGroundLocoManeuver::cGroundLocoManeuver(cGroundLocoManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const sMcMoveParams *params); +void __thiscall cGroundLocoManeuver::cGroundLocoManeuver(cGroundLocoManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const sMcMoveParams *params); // idb void __thiscall cGroundLocoManeuver::~cGroundLocoManeuver(cGroundLocoManeuver *this); // idb void __thiscall cGroundLocoManeuver::GetExpectedEndMoveState(cGroundLocoManeuver *this, sMcMoveState *moveState); // idb void __thiscall cGroundLocoManeuver::Execute(cGroundLocoManeuver *this); // idb @@ -40462,7 +40462,7 @@ cGroundLocoManeuver *__thiscall cGroundLocoManeuver::`vector deleting destructor void _E7_35(); void _E6_29(); cMotionPlan *__thiscall cPlayerManeuverFactory::CreatePlan(cPlayerManeuverFactory *this, const cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); // idb -void __thiscall cPlayerManeuver::cPlayerManeuver(cPlayerManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const sMcMoveParams *params); +void __thiscall cPlayerManeuver::cPlayerManeuver(cPlayerManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const sMcMoveParams *params); // idb void __thiscall cPlayerManeuver::~cPlayerManeuver(cPlayerManeuver *this); // idb void __thiscall cPlayerManeuver::GetExpectedEndMoveState(cPlayerManeuver *this, sMcMoveState *moveState); // idb void __thiscall cPlayerManeuver::Execute(cPlayerManeuver *this); // idb @@ -40477,12 +40477,12 @@ void __thiscall cPlayerManeuver::NotifyAboutFrameFlags(cPlayerManeuver *this, in cPlayerManeuver *__thiscall cPlayerManeuver::`vector deleting destructor'(cPlayerManeuver *this, char __flags); void _E7_36(); void _E6_30(); -cMotionPlan *__thiscall cSingleManeuverFactory::CreatePlan(cSingleManeuverFactory *this, cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); +cMotionPlan *__thiscall cSingleManeuverFactory::CreatePlan(cSingleManeuverFactory *this, const cMotionSchema *pSchema, const sMcMotorState *motState, const sMcMoveState *moveState, const sMcMoveParams *params, IMotor *pMotor, cMotionCoordinator *pCoord); // idb cSingleManeuver *__thiscall cSingleManeuverFactory::LoadManeuver(cSingleManeuverFactory *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile); -void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema); +void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema); // idb void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, char *name); void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, int motionNum, int dummy); -void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, cMotionSchema *pSchema, const mxs_angvec *direction); +void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, const cMotionSchema *pSchema, const mxs_angvec *direction); // idb void __thiscall cSingleManeuver::cSingleManeuver(cSingleManeuver *this, IMotor *pMotor, cMotionCoordinator *pCoord, ITagFile *pTagFile, int *success); // idb void __thiscall cSingleManeuver::~cSingleManeuver(cSingleManeuver *this); // idb void __thiscall cSingleManeuver::GetExpectedEndMoveState(cSingleManeuver *this, sMcMoveState *moveState); // idb @@ -40508,7 +40508,7 @@ void __cdecl MvrSetTerrStandingOffset(int standingObj, mxs_vector *pOffset); // int __cdecl mp_get_component_id(int *compID, int motionNum, int jointID); // idb void __cdecl mp_get_rot_at_frame(quat *rot, int motionNum, int frame, int compID); // idb int __cdecl MvrGetRawMovement(IMotor *pMotor, int motionNum, sMotionPhys *phys); -int __cdecl MvrGetEndButtHeight(IMotor *pMotor, int motionNum, float *pHeight); +int __cdecl MvrGetEndButtHeight(IMotor *pMotor, int motionNum, float *pHeight); // idb void __cdecl MvrCalcSlidingCollisionResponse(const mxs_vector *pForces, int nForces, const mxs_vector *ovel, mxs_vector *nvel, char flags); void __cdecl FootfallCallback(int objID, IMotor *pMotor, cMotionCoordinator *pCoord, char flags); void __cdecl MvrInterruptCallback(int objID, IMotor *pMotor, cMotionCoordinator *pCoord, char flags); @@ -40517,7 +40517,7 @@ void __cdecl MvrHitCorpseCallback(int objID); void __cdecl MvrWeaponSwingCallback(int objID, IMotor *pMotor); void __cdecl MvrWeaponChargeCallback(int objID, IMotor *pMotor); void __cdecl MvrSearchCallback(int objID, IMotor *pMotor); -void __cdecl MvrProcessStandardFlags(IMotor *pMotor, cMotionCoordinator *pCoord, unsigned int flags); +void __cdecl MvrProcessStandardFlags(IMotor *pMotor, cMotionCoordinator *pCoord, int flags); void __cdecl MvrSendMotionMessage(int obj, int motionNum, eMotionStatus whatHappened, unsigned int flags); // idb void __cdecl MvrUtilsRegisterDefaultObjFlags(int obj); // idb void __cdecl MvrUtilsUnRegisterDefaultObjFlags(int obj); // idb @@ -41058,10 +41058,10 @@ void __thiscall cProperty::`vector deleting destructor'(void *this); void __thiscall cProperty::`vector deleting destructor'(void *this); -int __cdecl MSchUGetGaitData(cMotionSchema *pSchema, sMGaitSkillData **pData); -int __cdecl MSchUGetSwordActionType(cMotionSchema *pSchema, int *pType); -int __cdecl MSchUGetMotControllerID(cMotionSchema *pSchema, int *pID); -int __cdecl MSchUGetPlayerPosOffset(cMotionSchema *pSchema, mxs_vector *pPosOff, mxs_angvec *pAngOff); +int __cdecl MSchUGetGaitData(const cMotionSchema *pSchema, sMGaitSkillData **pData); // idb +int __cdecl MSchUGetSwordActionType(const cMotionSchema *pSchema, int *pType); // idb +int __cdecl MSchUGetMotControllerID(const cMotionSchema *pSchema, int *pID); // idb +int __cdecl MSchUGetPlayerPosOffset(const cMotionSchema *pSchema, mxs_vector *pPosOff, mxs_angvec *pAngOff); // idb int __cdecl MSchUGetPlayerSkillData(const cMotionSchema *pSchema, sMPlayerSkillData *pSkillData); // idb void __thiscall cMSkillSet::SetPersistentTags(cMSkillSet *this, const cTagSet *pTags); // idb int _E9_47(); @@ -41069,7 +41069,7 @@ void _E6_32(); int _E8_48(); void __cdecl _E7_38(); // idb cMotionPlan *__thiscall cMSkillSet::BuildPlanFromParams(cMSkillSet *this, const sMcMoveParams *pParams, const sMcMotorState *pMotorState, const sMcMoveState *pMoveState, IMotor *pMotor, cMotionCoordinator *pCoord); // idb -void __cdecl SetupTags(IMotor *pMotor, const cTagSet *pTags, sMotActorTagList **ppActTags); +void __cdecl SetupTags(IMotor *pMotor, const cTagSet *pTags, sMotActorTagList **ppActTags); // idb void __thiscall cMSkillSet::Pose(cMSkillSet *this, const cTagSet *pTags, float frac, IMotor *pMotor); // idb void __thiscall cTagDBInput::Clear(cTagDBInput *this); // idb int __thiscall cDABase>::SetSize(cDABase > *this, unsigned int newSize); // idb @@ -41156,7 +41156,7 @@ unsigned int CreatureSpewStandable(); void __cdecl CreatureDebugSaveLoadTest(); // idb int CreaturePosPropUnlock(); void __stdcall CrPosPropListener(sPropertyListenMsg *msg, PropListenerData__ *data); // idb -void __cdecl CreaturesInit(int nCreatureTypes, sCreatureDesc **ppCreatureDescs, const char **pCreatureTypeNames, cCreatureFactory **ppCreatureFactories); +void __cdecl CreaturesInit(int nCreatureTypes, sCreatureDesc **ppCreatureDescs, const char **pCreatureTypeNames, cCreatureFactory **ppCreatureFactories); // idb void __stdcall CreatureModelNameListener(sPropertyListenMsg *msg, PropListenerData__ *data); // idb void __stdcall CreatureNonPhysListener(sPropertyListenMsg *msg, PropListenerData__ *data); // idb int CreaturesClose(); @@ -41254,7 +41254,7 @@ void __thiscall cCreature::SetVelocity(cCreature *this, const mxs_angvec *dir, f int __thiscall cCreature::IsPhysical(cCreature *this); // idb BOOL __thiscall cCreature::IsBallistic(cCreature *this); int __thiscall cCreature::GetRootJointID(cCreature *this); // idb -void __thiscall cCreature::GetFocusRotOffset(cCreature *this, quat *pDest, quat *pBase, const quat *rots); +void __thiscall cCreature::GetFocusRotOffset(cCreature *this, quat *pDest, quat *pBase, const quat *rots); // idb const multiped *__thiscall cCreature::GetMultiped(cCreature *this); // idb double __thiscall cCreature::GetMotionScale(cCreature *this); Position *__thiscall cCreature::GetLocation(cCreature *this); @@ -41517,7 +41517,7 @@ void __thiscall cHumanoidCreature::cHumanoidCreature(cHumanoidCreature *this, in int __thiscall cHumanoidCreature::GetFocusJoint(cHumanoidCreature *this); // idb cHumanoidCreature *__thiscall cHumanoidCreature::`scalar deleting destructor'(cHumanoidCreature *this, char __flags); void __thiscall cHumanoidCreature::~cHumanoidCreature(cHumanoidCreature *this); // idb -void __thiscall cHumanoidCreature::GetFocusRotOffset(cHumanoidCreature *this, quat *pDest, quat *pBase, const quat *rots); +void __thiscall cHumanoidCreature::GetFocusRotOffset(cHumanoidCreature *this, quat *pDest, quat *pBase, const quat *rots); // idb cApparitionCreature *__thiscall cApparitionCreature::`vector deleting destructor'(cApparitionCreature *this, char __flags); void __thiscall cApparitionCreature::~cApparitionCreature(cApparitionCreature *this); // idb cCreature *__thiscall cApparitionCreatureFactory::CreateFromFile(cApparitionCreatureFactory *this, int type, int objID, void (__cdecl *func)(void *, unsigned int, unsigned int), int version); // idb @@ -41638,8 +41638,8 @@ void __thiscall cFilePanel::OnButtonList(cFilePanel *this, unsigned __int16 acti void __thiscall cFilePanel::OnLoopMsg(cFilePanel *this, int msg, tLoopMessageData__ *data); // idb void __thiscall cFilePanel::Message(cFilePanel *this, const char *msg); // idb void __thiscall cFilePanel::MessageNamed(cFilePanel *this, const char *name); // idb -unsigned __int8 __cdecl SliderMotionHandler(__int16 x, __int16 y, LGadSlider *vb); -unsigned __int8 __cdecl PointOverHandle(LGadSlider *vs, __int16 x, __int16 y); // idb +unsigned __int8 __cdecl SliderMotionHandler(unsigned __int16 x, unsigned __int16 y, LGadSlider *vb); +unsigned __int8 __cdecl PointOverHandle(LGadSlider *vs, unsigned __int16 x, unsigned __int16 y); void __cdecl UpdateHandle(LGadSlider *vs); // idb void __cdecl SliderChangeValue(LGadSlider *vs, __int16 action); // idb unsigned __int8 __cdecl SliderMouseHandler(__int16 x, __int16 y, __int16 action, __int16 wheel, LGadSlider *vb); @@ -41994,7 +41994,7 @@ int __stdcall cNetManager::IsNetworkGame(cNetManager *this); // idb unsigned int __stdcall cNetManager::NumPlayers(cNetManager *this); // idb unsigned int __stdcall cNetManager::MyPlayerNum(cNetManager *this); // idb int __stdcall cNetManager::ObjToPlayerNum(cNetManager *this, int player); -int __stdcall cNetManager::PlayerNumToObj(cNetManager *this, int player); +int __stdcall cNetManager::PlayerNumToObj(cNetManager *this, unsigned int player); // idb void __thiscall cPlayerInfoTable::SetObjID(cPlayerInfoTable *this, int playerNum, int playerID); // idb int __thiscall cPlayerInfoTable::GetObjID(cPlayerInfoTable *this, int playerNum); // idb void __stdcall cNetManager::SetPlayerName(cNetManager *this, const char *pName); // idb @@ -42014,7 +42014,7 @@ void __thiscall cNetManager::AddPlayer(cNetManager *this, unsigned int player); void __stdcall cNetManager::Leave(cNetManager *this); // idb void __thiscall cNetManager::SendQuitMessage(cNetManager *this); // idb int __stdcall cNetManager::GetTimeout(cNetManager *this); -void __stdcall cNetManager::SetTimeout(cNetManager *this, int timeout); +void __stdcall cNetManager::SetTimeout(cNetManager *this, unsigned int timeout); // idb void __stdcall cNetManager::SuspendMessaging(cNetManager *this); // idb int __stdcall cNetManager::Suspended(cNetManager *this); // idb void __stdcall cNetManager::ResumeMessaging(cNetManager *this); // idb @@ -42344,7 +42344,7 @@ void __thiscall cAutoIPtr::cAutoIPtr(cAutoIPtr::operator->(cIPtr *this); // idb void __thiscall cIPtr::cIPtr(cIPtr *this, IPanelMode *pUnknownInit); // idb void __cdecl StartVoiceChat(char *address); // idb -LSTATUS StopVoiceChat(); +UINT StopVoiceChat(); void __thiscall cObjectNetworking::RebuildProxyTable(cObjectNetworking *this); // idb void __cdecl SetHostObj(int obj, int host, int hostObjID); // idb int __cdecl GetHostObj(int obj, int *pHost, int *pHostObjID); // idb @@ -42676,9 +42676,9 @@ void *zero_stats(); char *__cdecl portal_scene_info(int vol); // idb BOOL __cdecl check_surface_visible(PortalCell *cell, PortalPolygonCore *poly); void __cdecl portal_mip_setup(float zoom); // idb -void __cdecl draw_polygon_wireframe(_r3s_point **points, int num_points, int color); -void __cdecl draw_polygon_vertices(_r3s_point **points, int num_points, int color); -void __cdecl draw_polygon_outline(PortalPolygonCore *poly, _r3s_point **points, int polygon_color, unsigned int outline_color); +void __cdecl draw_polygon_wireframe(_r3s_point **points, int num_points, unsigned int color); // idb +void __cdecl draw_polygon_vertices(_r3s_point **points, int num_points, unsigned int color); // idb +void __cdecl draw_polygon_outline(PortalPolygonCore *poly, _r3s_point **points, unsigned int polygon_color, unsigned int outline_color); // idb unsigned __int8 __cdecl poly_outline_by_flags(PortalPolygonCore *poly, _r3s_point **points, int MIP_level); // idb grs_bitmap *portal_do_blendtest(); void __cdecl compute_tmapping(st_PortalPolygonRenderInfo *render, unsigned __int8 not_light, st_PortalLightMap *lt, _r3s_point *anchor_point); // idb @@ -42686,7 +42686,7 @@ int __cdecl compute_mip3(st_PortalPolygonRenderInfo *render, PortalPlane *p); // int __cdecl compute_mip(st_PortalPolygonRenderInfo *render, PortalPlane *p); // idb void __cdecl draw_background_hack(int n, _r3s_point **vlist); // idb unsigned __int8 __cdecl draw_surface(PortalPolygonCore *poly, st_PortalPolygonRenderInfo *render, st_PortalLightMap *lt, int voff, st_ClipData *clip); -void __cdecl draw_wireframe(PortalPolygonCore *p, int voff, int color); +void __cdecl draw_wireframe(PortalPolygonCore *p, int voff, unsigned int color); // idb void __cdecl draw_cell_wireframe(PortalCell *cell, unsigned int color); // idb int __cdecl compute_water_clut(); void __cdecl portal_preload_lightmaps(int cell); // idb @@ -43267,7 +43267,7 @@ void __cdecl set_pnp_mode(int n); // idb void __cdecl do_pnp_mode(void *n); void __cdecl do_swap_mode(void *n); void __cdecl set_swap_mode(int n); // idb -void __cdecl set_coord_mask(int n); // idb +void __cdecl set_coord_mask(unsigned int n); void __cdecl coord_edit(char *str); // idb void setup_gfh_commands(); void __cdecl LayoutRectangles(Rect *bounds, Rect *rvec, int n, Point dims, Point sp); // idb @@ -43289,16 +43289,16 @@ void __cdecl ConvertPersistantCells(unsigned __int8 added_flags); // idb int __cdecl get_texture_for_medium_transition(int x, int y); // idb int __cdecl get_clut_for_medium_transition(unsigned __int8 x, unsigned __int8 y); _CycleGadg *__cdecl CreateintCycleGadg(_CycleGadg *gadg, _LGadRoot *root, _CycleGadgDesc *desc, _intCycleGadgDesc *typedesc); // idb -bool __cdecl int_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, int *var, _CycleGadgDesc *desc); +unsigned __int8 __cdecl int_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, int *var, _CycleGadgDesc *desc); void __cdecl DestroyintCycleGadg(_CycleGadg *gadg); // idb _CycleGadg *__cdecl CreatefloatCycleGadg(_CycleGadg *gadg, _LGadRoot *root, _CycleGadgDesc *desc, _floatCycleGadgDesc *typedesc); // idb -bool __cdecl float_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, float *var, _CycleGadgDesc *desc); +unsigned __int8 __cdecl float_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, float *var, _CycleGadgDesc *desc); void __cdecl DestroyfloatCycleGadg(_CycleGadg *gadg); // idb _CycleGadg *__cdecl CreateshortCycleGadg(_CycleGadg *gadg, _LGadRoot *root, _CycleGadgDesc *desc, _shortCycleGadgDesc *typedesc); // idb -bool __cdecl short_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, __int16 *var, _CycleGadgDesc *desc); +unsigned __int8 __cdecl short_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, __int16 *var, _CycleGadgDesc *desc); void __cdecl DestroyshortCycleGadg(_CycleGadg *gadg); // idb _CycleGadg *__cdecl CreatefixangCycleGadg(_CycleGadg *gadg, _LGadRoot *root, _CycleGadgDesc *desc, _fixangCycleGadgDesc *typedesc); // idb -bool __cdecl fixang_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, unsigned __int16 *var, _CycleGadgDesc *desc); +unsigned __int8 __cdecl fixang_cycle_cb(_CycleGadg *gadg, unsigned int act, int part, unsigned __int16 *var, _CycleGadgDesc *desc); void __cdecl DestroyfixangCycleGadg(_CycleGadg *gadg); // idb void __cdecl UpdateCycleGadg(_CycleGadg *gadg, unsigned __int8 redraw); // idb void __cdecl read_text_buf(_CycleGadg *gadg); // idb @@ -43449,7 +43449,7 @@ void __cdecl _editsave_text_info(char *buf); // idb int __cdecl editor_SaveCow(ITagFile *file); // idb int __cdecl saveAllBrushes(ITagFile *file, int groupFilter); // idb bool __cdecl saveSingleBrush(_editBrush *us, int sz); -int __cdecl saveBrushHeader(ITagFile *file); // idb +BOOL __cdecl saveBrushHeader(ITagFile *file); int __cdecl saveFlowTextureIndices(ITagFile *file); // idb int __cdecl editor_LoadCow(ITagFile *file); // idb int __cdecl loadAllBrushes(ITagFile *file, int preserve_id); // idb @@ -43460,7 +43460,7 @@ int __cdecl editor_PostLoadCow(); // idb int __cdecl editor_SaveMiniBrush(char *fname, int group); // idb int __cdecl saveAllObjs(ITagFile *file, int group); // idb BOOL __stdcall vbr_partition_func(int obj, const sObjPartitionFilter *f); -int __cdecl saveMiniBrushHeader(ITagFile *file); // idb +BOOL __cdecl saveMiniBrushHeader(ITagFile *file); int __cdecl editor_LoadMiniBrush(char *fname, int new_group); // idb int __cdecl loadAllObjs(ITagFile *file); // idb int __cdecl loadMiniBrushHeader(ITagFile *file); // idb @@ -43721,12 +43721,12 @@ void __cdecl hilight_end(char flags); void __cdecl hilight_active_check(_editBrush *br); // idb BOOL __cdecl highlight_check(_editBrush *br); void __cdecl hilight_obj_with_property(char *str); // idb -int __cdecl hilight_simple_run(int (__cdecl *br_check)(_editBrush *)); // idb +BOOL __cdecl hilight_simple_run(int (__cdecl *br_check)(_editBrush *)); int __cdecl property_check(_editBrush *br); // idb void __cdecl hilight_obj_with_property_direct(char *str); // idb int __cdecl property_check_direct(_editBrush *br); // idb int hilight_split_obj(); -int hilight_nonaxial_terrain(); +BOOL hilight_nonaxial_terrain(); BOOL __cdecl nonaxial_check(_editBrush *br); void __cdecl hilight_media_type(int media_id); // idb BOOL __cdecl terr_media_check(_editBrush *br); @@ -44037,10 +44037,10 @@ int _E10_39(); void __cdecl _E9_51(); // idb int __cdecl ReportRegisterObjCallback(void (__cdecl *cb)(int, int, void *, char *, eReportPhase), char *name, void *data); // idb int __cdecl register_cb(void *cb, int flags, char *name, void *data); // idb -int __cdecl ReportRegisterGenCallback(void (__cdecl *cb)(int, void *, char *), int type, char *name, void *data); +int __cdecl ReportRegisterGenCallback(void (__cdecl *cb)(int, void *, char *), eReportType type, char *name, void *data); // idb int __cdecl ReportUnRegisterObjCallback(void (__cdecl *cb)(int, int, void *, char *, eReportPhase), void *data); // idb int __cdecl unregister_cb(void *cb, int flags, void *data); // idb -int __cdecl ReportUnRegisterGenCallback(void (__cdecl *cb)(int, void *, char *), int type, void *data); +int __cdecl ReportUnRegisterGenCallback(void (__cdecl *cb)(int, void *, char *), eReportType type, void *data); // idb int _E16_17(); void _E13_39(); int _E15_26(); @@ -44222,7 +44222,7 @@ int __cdecl songyywrap(); // idb int __cdecl songyyerror(char *errmsg); // idb int __cdecl SongYaccParse(char *songFile, ISong **ppSong); // idb int __cdecl songyyparse(); // idb -int __cdecl FindSectionIndexFromID(ISong *pSong, char *id); +unsigned int __cdecl FindSectionIndexFromID(ISong *pSong, char *id); // idb int __cdecl StringLengthErrorCheck(char *pStr); // idb int __cdecl SongEd_Init(); // idb void __cdecl SongEd_Shutdown(); // idb @@ -44245,7 +44245,7 @@ int __stdcall cStringEditTrait::Edit(cStringEditTrait *this, int obj); // idb void __thiscall sBuf::sBuf(sBuf *this, const char *s); // idb sBuf *__thiscall sBuf::operator char const *(sBuf *this); int __stdcall cStringEditTrait::Parse(cStringEditTrait *this, int obj, const char *val); // idb -int __stdcall cStringEditTrait::Unparse(cStringEditTrait *this, int obj, char *buf, int buflen); // idb +int __stdcall cStringEditTrait::Unparse(cStringEditTrait *this, int obj, char *buf, size_t buflen); cStringEditTrait *__thiscall cStringEditTrait::`scalar deleting destructor'(cStringEditTrait *this, char __flags); void __thiscall cStringEditTrait::~cStringEditTrait(cStringEditTrait *this); // idb void __cdecl MethodOpen(methodizer *m, int kind, _LGadRoot *root, Rect *bounds, _editBrush *brush); // idb @@ -44402,7 +44402,7 @@ void vbrui_clone_brush(); int vbrui_build_brush(); void __cdecl br_update_obj(_editBrush *us); // idb void __cdecl vbrui_load_group(char *str); // idb -char *__cdecl get_real_fname_0(char *str, int fMode); // idb +char *__cdecl get_real_fname_0(char *str, eFileMenuMode fMode); char *__cdecl make_brush_fname(char *str); // idb void __cdecl vbrui_save_group(char *str); // idb void __cdecl brFlag_Toggle(_editBrush *us, int flag); // idb @@ -44534,7 +44534,7 @@ void __cdecl vmWindowsRefresh(int resize); // idb void __cdecl vmNewBoundingRect(Rect *bounds); // idb void __cdecl vmGetReferenceSize(Point *size); // idb double __cdecl vmGetSizeRatio(int r, float *xrat, float *yrat); -int __cdecl vmScrollCamera(int c); // idb +BOOL __cdecl vmScrollCamera(int c); BOOL __cdecl doWinScroll(int c); void __cdecl vmWinCfgCycleLayout(int new_layout); // idb int __cdecl vmWinCfgGetLayout(); // idb @@ -44573,9 +44573,9 @@ void __cdecl build_mask_rect(unsigned int mask, Rect *r); // idb int __cdecl vmReleaseViews(_LGadRoot *release); // idb int __cdecl vmReleaseAllViews(); // idb int __cdecl vmAllViewsAvailable(); // idb -unsigned __int8 __cdecl SliderMotionHandler(__int16 x, __int16 y, LGadSlider *vb); +unsigned __int8 __cdecl SliderMotionHandler(unsigned __int16 x, unsigned __int16 y, LGadSlider *vb); void __cdecl SliderChangeValue_0(LGadSlider *vs); // idb -unsigned __int8 __cdecl PointOverHandle_0(LGadSlider *vs, __int16 x, __int16 y); // idb +unsigned __int8 __cdecl PointOverHandle_0(LGadSlider *vs, unsigned __int16 x, unsigned __int16 y); unsigned __int8 __cdecl SliderMouseHandler(__int16 x, __int16 y, __int16 action, __int16 wheel, LGadSlider *vb); void __cdecl SliderSetGrab_0(LGadSlider *vs, __int16 x, __int16 y); // idb void __cdecl SliderMoveHandle_0(LGadSlider *vs, __int16 x, __int16 y); // idb @@ -45021,7 +45021,7 @@ void __thiscall cBook::cBook(cBook *this); // idb cBook *__thiscall cBook::`scalar deleting destructor'(cBook *this, char __flags); void __thiscall cBook::~cBook(cBook *this); // idb const sBreathConfig *__cdecl GetObjBreathConfig(int obj); // idb -void __cdecl SetObjBreathConfig(int obj, sBreathConfig *cfg); +void __cdecl SetObjBreathConfig(int obj, sBreathConfig *cfg); // idb void __cdecl init_air_prop(); // idb void __cdecl SetObjAirSupply(int obj, int air); // idb int __cdecl GetObjAirSupply(int obj); // idb @@ -45476,7 +45476,7 @@ void _E14_46(); void _E13_40(); void __thiscall cDarkInvSrv::~cDarkInvSrv(cDarkInvSrv *this); // idb void __thiscall cDarkInvSrv::cDarkInvSrv(cDarkInvSrv *this); // idb -void __stdcall cDarkInvSrv::CapabilityControl(cDarkInvSrv *this, int cap_change, int control); +void __stdcall cDarkInvSrv::CapabilityControl(cDarkInvSrv *this, eDrkInvCap cap_change, eDrkInvControl control); // idb void __stdcall cDarkInvSrv::AddSpeedControl(cDarkInvSrv *this, const char *name, float speed_fac, float rot_fac); // idb void __stdcall cDarkInvSrv::RemoveSpeedControl(cDarkInvSrv *this, const char *name); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -45509,17 +45509,17 @@ BOOL __cdecl is_expired(int sel); BOOL __cdecl same_frob(const sFrobActivate *a, const sFrobActivate *b); void __cdecl build_item_frob(int inv, int world, sFrobActivate *pfrob); // idb void __cdecl use_weapon_command(int finish); // idb -void __cdecl cycle_weapon_command(int dir); // idb +void __cdecl cycle_weapon_command(eCycleDirection dir); void __cdecl next_weapon_command(int count); // idb void __cdecl prev_weapon_command(int count); // idb -void __cdecl cycle_item_command(int dir); // idb +void __cdecl cycle_item_command(eCycleDirection dir); void __cdecl next_item_command(int count); // idb void __cdecl prev_item_command(int count); // idb void __cdecl select_command(char *arg); // idb void __cdecl abort_frob(int which); // idb int select_loot_command(); int drop_command(); -int __cdecl throw_obj(int thrower, int obj, float power); // idb +BOOL __cdecl throw_obj(int thrower, int obj, float power); void clear_weapon_command(); void __cdecl clear_selection_internal(eWhichInvObj sel); // idb void clear_item_command(); @@ -45627,7 +45627,7 @@ void __thiscall cOptions::GetBindingStrings(cOptions *this, int bind_num, cAnsiS unsigned __int8 __cdecl cOptions::StaticBindKeyHandler(_ui_event *p_event); unsigned __int8 __thiscall cOptions::BindKeyHandler(cOptions *this, _ui_cooked_key_event *event); // idb unsigned __int8 __cdecl cOptions::StaticMouseWheelHandler(_ui_event *p_event); -void __thiscall cOptions::InitButtonList(cOptions *this, _LGadButtonListDesc *desc, _LGadButtonList *list, Rect *rect_array, _DrawElement *draw_elem, unsigned __int8 (__cdecl *cb)(unsigned __int16, int, void *, _LGadBox *), cAnsiStr *strs, const char *prefix, int num, int flags); // idb +void __thiscall cOptions::InitButtonList(cOptions *this, _LGadButtonListDesc *desc, _LGadButtonList *list, Rect *rect_array, _DrawElement *draw_elem, unsigned __int8 (__cdecl *cb)(unsigned __int16, int, void *, _LGadBox *), cAnsiStr *strs, const char *prefix, int num, unsigned int flags); void __thiscall cOptions::LoadButtBmp(cOptions *this, IRes **butt_res, _DrawElement *draw_elem, char *prefix); // idb void __thiscall cOptions::SetUIString(cOptions *this, cAnsiStr *str, _DrawElement *draw_elem, char *name, char *suffix); // idb void __thiscall cOptions::AppendRects(cOptions *this, char *rect_file, cDynArray *old_rects); // idb @@ -45725,7 +45725,7 @@ int __stdcall cCTUnaggregated::AddRef(cCTUnaggregated *this); // idb unsigned int __stdcall cCTUnaggregated::Release(cCTUnaggregated *this); // idb int __cdecl DrkObjTryDeploy(int src_obj, int deploy_arch); // idb -int __cdecl has_linker(int obj, void *data); // idb +BOOL __cdecl has_linker(int obj, void *data); void __cdecl DrkTriggerWorldFlash(int obj); // idb double __cdecl check_flash_effect(int flash, Position *flash_pos, int target, float power); int __cdecl GetFlashArchetype(int obj); // idb @@ -45899,8 +45899,8 @@ void __cdecl main_volume_up_cmd(int count); // idb void __cdecl main_volume_down_cmd(int count); // idb void __thiscall DarkSoundInit(void *this); void __cdecl env_sound_CB(sESndEvent *ev); // idb -void __cdecl set_second_tag(cTagSet *s1, cTagSet *s2, cAnsiStr *key); -cTag *__cdecl find_tag_with_key(cTagSet *set, cAnsiStr *key); +void __cdecl set_second_tag(cTagSet *s1, cTagSet *s2, cAnsiStr *key); // idb +cTag *__cdecl find_tag_with_key(cTagSet *set, cAnsiStr *key); // idb void (__cdecl *DarkSoundTerm())(sESndEvent *); void __cdecl _DarkStatIntAdd(char *StatName, int val, int campaign); // idb int __cdecl _DarkStatIntGet(char *StatName); // idb @@ -45922,13 +45922,13 @@ void _E14_49(); void _E13_43(); void __thiscall cDarkUISrv::~cDarkUISrv(cDarkUISrv *this); // idb void __thiscall cDarkUISrv::cDarkUISrv(cDarkUISrv *this); // idb -int __stdcall cDarkUISrv::TextMessage(cDarkUISrv *this, const char *message, int color, int timeout); // idb +int __stdcall cDarkUISrv::TextMessage(cDarkUISrv *this, const char *message, int color, unsigned int timeout); int __stdcall cDarkUISrv::ReadBook(cDarkUISrv *this, const char *text, const char *art); // idb object *__stdcall cDarkUISrv::InvItem(cDarkUISrv *this, object *result); // idb object *__stdcall cDarkUISrv::InvWeapon(cDarkUISrv *this, object *result); // idb int __stdcall cDarkUISrv::InvSelect(cDarkUISrv *this, object obj); // idb -true_bool *__stdcall cDarkUISrv::IsCommandBound(cDarkUISrv *this, true_bool *result, cScrStr *__$ReturnUdt); -cScrStr *__stdcall cDarkUISrv::DescribeKeyBinding(cDarkUISrv *this, cScrStr *result, cScrStr *__$ReturnUdt); +true_bool *__stdcall cDarkUISrv::IsCommandBound(cDarkUISrv *this, true_bool *result, cScrStr *__$ReturnUdt); // idb +cScrStr *__stdcall cDarkUISrv::DescribeKeyBinding(cDarkUISrv *this, cScrStr *result, cScrStr *__$ReturnUdt); // idb void __thiscall cScriptServiceImplBase::~cScriptServiceImplBase(cScriptServiceImplBase *this); // idb cDarkUISrv *__thiscall cDarkUISrv::`vector deleting destructor'(cDarkUISrv *this, char __flags); void __thiscall cScriptServiceImplBase::cScriptServiceImplBase(cScriptServiceImplBase *this); // idb @@ -46022,7 +46022,7 @@ void PlayerBowAlignArrow(); void __cdecl SetBowZoomActive(int active); // idb bool BowInit(); void BowTerm(); -void __thiscall cMxsVectorHack::cMxsVectorHack(cMxsVectorHack *this, float _x, float _y, float _z); // idb +void __thiscall cMxsVectorHack::cMxsVectorHack(cMxsVectorHack *this, float _x, unsigned int _y, unsigned int _z); void __thiscall cMxsAngvecHack::cMxsAngvecHack(cMxsAngvecHack *this, unsigned __int16 _x, unsigned __int16 _y, unsigned __int16 _z); // idb int _E15_31(); void _E12_36(); @@ -46168,7 +46168,7 @@ ePickResult __cdecl _DoPickOperation(int picker, int pick, int lock, unsigned in ePickResult __cdecl PickLockMatchLevel(int pick, int lock); void __cdecl PickLockDoStop(int pick); // idb void __cdecl PickLockClearState(int pick); // idb -void __cdecl PickLockPerFrameCallback(int dt); +void __cdecl PickLockPerFrameCallback(unsigned int dt); // idb int __cdecl PickLockReady(); int __cdecl PickLockUnReady(); int __cdecl PickLockStartPicking(int frobber, int pick_obj, int locked_obj); // idb @@ -46556,7 +46556,7 @@ void __thiscall cStatusBar::Update(cStatusBar *this, unsigned int time); // idb void VisMeterEnterMode(); void VisMeterExitMode(); void __cdecl VisMeterSetCutoffs(const int *cutoffs, unsigned int n); -void __cdecl VisMeterUpdate(int time, const Rect *r); +void __cdecl VisMeterUpdate(unsigned int time, const Rect *r); // idb void recompute(); int _E11_56(); void _E8_60(); @@ -46897,7 +46897,7 @@ int __stdcall HashString(const char *pszKey); int __stdcall HashStringCaseless(const char *pszKey); unsigned int __stdcall HashGUID(const _GUID *pID); // idb unsigned int __stdcall HashPtr(unsigned int p); -unsigned int __stdcall HashLong(int key); // idb +unsigned int __stdcall HashLong(unsigned int key); int __stdcall HashThing(char *pKey, unsigned int size); IUnknown *__stdcall _AppGetAggregated(const _GUID *iid); // idb void __stdcall _AppSetAggregate(IUnknown *pUnknown); // idb @@ -46938,7 +46938,7 @@ void (__stdcall *__stdcall LogSetMessageFunc(void (__stdcall *pfnNew)(const char int __stdcall LogGetIndent(); // idb void __stdcall LogIncIndent(); void __stdcall LogDecIndent(); -char *__stdcall LogStrWinMsg(HWND__ *hwnd, unsigned int msg, unsigned int wParam, int lParam); +char *__stdcall LogStrWinMsg(HWND__ *hwnd, unsigned int msg, unsigned int wParam, unsigned int lParam); char *__cdecl GetMessageName(unsigned int uMessage); int __cdecl SearchEquivalenceTable(const sStrULongEquivalence *pStrULongEquivalence, unsigned int ulLookup, char *pszReturn); // idb char *__cdecl InterpretWParam(unsigned int uMessage, unsigned int wParam); @@ -46959,7 +46959,7 @@ int __cdecl uint_to_str(char *buf, unsigned int val, unsigned int base, char alp void __cdecl DatapathFree(Datapath *pdp); // idb _iobuf *__cdecl DatapathOpen(Datapath *pdp, const char *fname, const char *mode); // idb int DatapathFDOpen(Datapath *pdp, const char *fname, int access, int a4, ...); -int __cdecl DatapathFind(Datapath *pdp, const char *fname, char *buff, unsigned int len); +int __cdecl DatapathFind(Datapath *pdp, const char *fname, char *buff, size_t len); unsigned __int8 __cdecl DatapathAdd(Datapath *pdp, const char *path); // idb unsigned __int8 __cdecl DatapathAddDir(Datapath *pdp, const char *pdir); // idb char *__cdecl DatapathLastPath(Datapath *pdp); // idb @@ -46986,7 +46986,7 @@ int __cdecl temp_spew_mem_init(MemStack *ms, char *file, int line); // idb int __cdecl temp_spew_mem_uninit(char *file, const char *line); char *__cdecl temp_spew_malloc(int size, char *file, int line); char *__cdecl temp_spew_realloc(char *ptr, int size, char *file, int line); -int __cdecl temp_spew_free(void *ptr, char *file, int line); // idb +BOOL __cdecl temp_spew_free(void *ptr, char *file, int line); int DbgInit(); unsigned __int8 DbgMonoConfig(); void __cdecl DbgMonoHandleInput(__int16 page); // idb @@ -47034,7 +47034,7 @@ void __thiscall IDebugMalloc::IDebugMalloc(IDebugMalloc *this); // idb // void __thiscall cMallocBase::~cMallocBase(cMallocBase *this); idb void __thiscall cFastMutex::Lock(cFastMutex *this); // idb void __thiscall cFastMutex::Unlock(cFastMutex *this); // idb -LPVOID __stdcall NoOpAlloc(sNoOpMalloc *pThis, unsigned int n); +LPVOID __stdcall NoOpAlloc(sNoOpMalloc *pThis, SIZE_T n); void __stdcall NoOpFree(sNoOpMalloc *__formal, void *a2); // idb void __cdecl mx_zero_vec(mxs_vector *v); // idb void __cdecl mx_unit_vec(mxs_vector *v, int n); // idb @@ -47187,7 +47187,7 @@ void __cdecl mxd_mat_tmul_vec(mxds_vector *dest, const mxds_matrix *m, const mxd void __cdecl mxd_mat_tmuleq_vec(const mxds_matrix *m, mxds_vector *v); // idb double __cdecl mxd_mat_look_at_z(mxds_matrix *dest, const mxds_vector *v, const mxds_vector *z); double __cdecl mxd_mat_look_at(mxds_matrix *dest, const mxds_vector *v); -long double __cdecl mxd_mat_look_at_safe(mxds_matrix *dest, const mxds_vector *v); // idb +double __cdecl mxd_mat_look_at_safe(mxds_matrix *dest, const mxds_vector *v); __int64 __cdecl mxd_rad2ang(long double rad); double __cdecl mxd_ang2rad(unsigned __int16 ang); __int64 __cdecl mxd_deg2ang(long double deg); @@ -47276,7 +47276,7 @@ int __cdecl fix_sloppy_sqrt(int a1); int __cdecl fix24_sqrt(int a1); // int __usercall fix24_sqrt_asm@(int a1@); // int __usercall quad_sqrt@(int _EAX@, unsigned int a2@); -void __cdecl HheapInit(HheapHead *phh, unsigned __int16 sizeItem, __int16 numItemsPerChunk, unsigned __int8 shrink); // idb +void __cdecl HheapInit(HheapHead *phh, unsigned __int16 sizeItem, unsigned __int16 numItemsPerChunk, unsigned __int8 shrink); void __cdecl HheapFreeAll(HheapHead *phh); // idb _DWORD *__cdecl HheapAlloc(HheapHead *phh); _DWORD *__cdecl HheapCalloc(HheapHead *phh); @@ -47285,15 +47285,15 @@ void __cdecl HheapAllocChunk(HheapHead *phh); // idb void __cdecl llist_insert_queue(_llist_head *plh, _llist *plq); unsigned __int8 __cdecl llist_move_queue(_llist_head *plh, _llist *plq); int __cdecl llist_num_nodes(_llist_head *plh); // idb -void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, cAnsiStr *Str); +void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, cAnsiStr *Str); // idb void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, const char *pStr); // idb void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, char ch); // idb -void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, const char *pStr, int nLen); // idb +void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, const char *pStr, unsigned int nLen); void __thiscall cAnsiStr::cAnsiStr(cAnsiStr *this, int nLen); // idb void __thiscall cAnsiStr::AllocBuffer(cAnsiStr *this, unsigned int nReqLen); -void __thiscall cAnsiStr::AllocCopy(cAnsiStr *this, cAnsiStr *dest, int nCopyLen, int nCopyIndex, int nExtraLen); // idb +void __thiscall cAnsiStr::AllocCopy(cAnsiStr *this, cAnsiStr *dest, size_t nCopyLen, int nCopyIndex, int nExtraLen); void __thiscall cAnsiStr::Assign(cAnsiStr *this, int nSrcLen, char *pszSrcData); -void __thiscall cAnsiStr::ConcatCopy(cAnsiStr *this, int nSrc1Len, const char *pszSrc1Data, int nSrc2Len, const char *pszSrc2Data); // idb +void __thiscall cAnsiStr::ConcatCopy(cAnsiStr *this, size_t nSrc1Len, const char *pszSrc1Data, size_t nSrc2Len, const char *pszSrc2Data); cAnsiStr *__cdecl operator+(cAnsiStr *result, const cAnsiStr *__$ReturnUdt, const cAnsiStr *string1); // idb cAnsiStr *__cdecl operator+(cAnsiStr *result, const cAnsiStr *__$ReturnUdt, const char *string); // idb cAnsiStr *__cdecl operator+(cAnsiStr *result, const char *__$ReturnUdt, const cAnsiStr *psz); // idb @@ -47306,23 +47306,23 @@ int __thiscall cAnsiStr::Find(cAnsiStr *this, char ch, int nFirst); // idb int __thiscall cAnsiStr::ReverseFind(cAnsiStr *this, char ch); // idb int __thiscall cAnsiStr::FindOneOf(cAnsiStr *this, const char *pszCharSet, int nFirst); // idb int __thiscall cAnsiStr::Find(cAnsiStr *this, const char *pszSub, int nFirst); // idb -void __thiscall cAnsiStr::DoGrowBuffer(cAnsiStr *this, int nMinBufLength); // idb +void __thiscall cAnsiStr::DoGrowBuffer(cAnsiStr *this, unsigned int nMinBufLength); char *__thiscall cAnsiStr::Detach(cAnsiStr *this); // idb void __thiscall cAnsiStr::Attach(cAnsiStr *this, char *pNewBuff, int nNewLength, int nNewAlloc); // idb void __thiscall cAnsiStr::BufDone(cAnsiStr *this, int nNewLength, int nNewAlloc); // idb -int __thiscall cAnsiStr::Insert(cAnsiStr *this, const char *psz, int nIndex); // idb -int __thiscall cAnsiStr::Insert(cAnsiStr *this, char ch, int nIndex); // idb +size_t __thiscall cAnsiStr::Insert(cAnsiStr *this, const char *psz, int nIndex); +size_t __thiscall cAnsiStr::Insert(cAnsiStr *this, char ch, int nIndex); void __thiscall cAnsiStr::Remove(cAnsiStr *this, int nStart, int nLength); // idb char *__thiscall cAnsiStr::ReverseExcluding(cAnsiStr *this, const char *pszCharSet, int nFirst); char *__thiscall cAnsiStr::ReverseIncluding(cAnsiStr *this, const char *pszCharSet, int nFirst); void __thiscall cAnsiStr::Trim(cAnsiStr *this); // idb -char *__thiscall cAnsiStr::AllocStr(cAnsiStr *this, int len); // idb -char *__thiscall cAnsiStr::ReallocStr(cAnsiStr *this, char *p, int len); // idb +char *__thiscall cAnsiStr::AllocStr(cAnsiStr *this, unsigned int len); +char *__thiscall cAnsiStr::ReallocStr(cAnsiStr *this, char *p, unsigned int len); void __thiscall cAnsiStr::FreeStr(cAnsiStr *this, char *p); // idb const cAnsiStr *__thiscall cAnsiStr::Quoted(cAnsiStr *this, cAnsiStr::eQuoteMode mode); // idb -void cAnsiStr::FmtStr(cAnsiStr *this, int nBufSize, const char *format, ...); +void cAnsiStr::FmtStr(cAnsiStr *this, unsigned int nBufSize, const char *format, ...); // idb void cAnsiStr::FmtStr(cAnsiStr *this, const char *format, ...); // idb -void cAnsiStr::FmtStr(cAnsiStr *this, int nBufSize, unsigned __int16 nID, ...); +void cAnsiStr::FmtStr(cAnsiStr *this, unsigned int nBufSize, unsigned __int16 nID, ...); // idb void cAnsiStr::FmtStr(cAnsiStr *this, unsigned __int16 nID, ...); // idb int __thiscall cAnsiStr::LoadStringA(cAnsiStr *this, unsigned __int16 nID); // idb int __thiscall cAnsiStr::ToStream(cAnsiStr *this, struct cOStore *__formal); // idb @@ -47351,7 +47351,7 @@ int __cdecl cHashSetBase::SecondaryHash(char primary); tHashSetNode__ *__thiscall cHashSetBase::Insert(cHashSetBase *this, tHashSetNode__ *a); // idb tHashSetNode__ *__thiscall cHashSetBase::RemoveByHandle(cHashSetBase *this, const tHashSetHandle *h); // idb void __thiscall cHashSetBase::Rehash(cHashSetBase *this, tHashSetHandle OldHandle, tHashSetNode__ *a); // idb -int __thiscall cHashSetBase::operator<=(cHashSetBase *this, cHashSetBase *h); +int __thiscall cHashSetBase::operator<=(cHashSetBase *this, cHashSetBase *h); // idb BOOL __thiscall cHashSetBase::operator==(cHashSetBase *this, cHashSetBase *h); BOOL __thiscall cHashSetBase::operator!=(cHashSetBase *this, cHashSetBase *h); void __thiscall cHashSetBase::Resize(cHashSetBase *this, unsigned int NewSize); // idb @@ -47362,13 +47362,13 @@ void __thiscall cHashSetBase::DumpTable(cHashSetBase *this); // idb cHashSetBase *__thiscall cHashSetBase::`scalar deleting destructor'(cHashSetBase *this, char __flags); int __thiscall cDListNodeBase::CountBackwards(cDListNodeBase *this); // idb void __thiscall cFileSpec::cFileSpec(cFileSpec *this, const cFileSpec *fs); // idb -void __thiscall cFileSpec::cFileSpec(cFileSpec *this, sFileDesc *fs); +void __thiscall cFileSpec::cFileSpec(cFileSpec *this, sFileDesc *fs); // idb void __thiscall cFileSpec::cFileSpec(cFileSpec *this, eFileSpecKind kind, const char *s); // idb void __thiscall cFileSpec::cFileSpec(cFileSpec *this, const char *name); // idb -void __thiscall cFileSpec::cFileSpec(cFileSpec *this, cFilePath *path, const char *name); +void __thiscall cFileSpec::cFileSpec(cFileSpec *this, cFilePath *path, const char *name); // idb // void __thiscall cFileSpec::~cFileSpec(cFileSpec *this); idb cFileSpec *__thiscall cFileSpec::operator=(cFileSpec *this, cFileSpec *fs); -void __thiscall cFileSpec::Set(cFileSpec *this, cFilePath *Path, const char *psz); +void __thiscall cFileSpec::Set(cFileSpec *this, cFilePath *Path, const char *psz); // idb int __thiscall cFileSpec::MakeFullPath(cFileSpec *this); // idb int __thiscall cFileSpec::GetFullPath(cFileSpec *this, cAnsiStr *s); // idb void __thiscall cFileSpec::GetRelativePath(cFileSpec *this, cAnsiStr *s); // idb @@ -47384,13 +47384,13 @@ const char *__thiscall cFileSpec::GetFileName(cFileSpec *this); // idb void __thiscall cFileSpec::GetFileName(cFileSpec *this, cAnsiStr *s); // idb void __thiscall cFileSpec::SetFileName(cFileSpec *this, const char *filename); // idb void __thiscall cFileSpec::GetFilePath(cFileSpec *this, cFilePath *fp); // idb -void __thiscall cFileSpec::SetFilePath(cFileSpec *this, cFilePath *path); +void __thiscall cFileSpec::SetFilePath(cFileSpec *this, cFilePath *path); // idb BOOL __thiscall cFileSpec::FileExists(cFileSpec *this); BOOL __thiscall cFileSpec::UnlinkFile(cFileSpec *this); int __thiscall cFileSpec::GetModificationTime(cFileSpec *this); void __thiscall cFileSpec::SetUntitledNumber(cFileSpec *this, int iUntitled); // idb void __thiscall cFileSpec::SetSpecialName(cFileSpec *this, const char *psz); // idb -int __thiscall cFileSpec::Compare(cFileSpec *this, sFileDesc *FileSpec); +int __thiscall cFileSpec::Compare(cFileSpec *this, sFileDesc *FileSpec); // idb int __thiscall cFileSpec::ToStream(cFileSpec *this, struct cOStore *OStore); // idb int __thiscall cFileSpec::FromStream(cFileSpec *this, struct cIStore *IStore); // idb BOOL __thiscall cFileSpec::operator==(cFileSpec *this, sFileDesc *FileSpec); @@ -47402,7 +47402,7 @@ void __cdecl cFileSpec::SetAnchorPath(const cFilePath *NewAnchorPath); // idb void __thiscall cFileSpec::GetNameString(cFileSpec *this, cAnsiStr *Name, eFileSpecNameStringStyle Style); // idb void __thiscall cFileSpec::GetNameString(cFileSpec *this, cAnsiStr *Str, int iDesiredLength); // idb cAnsiStr *__cdecl GetCondensePathStr(cAnsiStr *Path, unsigned int nCondenseToLen, eFileCondenseCase CaseChange, int bRequireDrive); // idb -void __thiscall cFileSpec::GetNameString(cFileSpec *this, cAnsiStr *Str, cFilePath *fpRelativeTo); +void __thiscall cFileSpec::GetNameString(cFileSpec *this, cAnsiStr *Str, cFilePath *fpRelativeTo); // idb BOOL __thiscall cFileSpec::IsReadOnly(cFileSpec *this); int __thiscall cFileSpec::IsWriteOnly(cFileSpec *this); // idb BOOL __thiscall cFileSpec::IsModified(cFileSpec *this); @@ -47424,12 +47424,12 @@ unsigned int __thiscall cFileSpec::GetMaxLegalComponentLen(cFileSpec *this); // int __thiscall cFileSpec::IsValidChar(cFileSpec *this, char c); // idb int __thiscall cFileSpec::IsValidComponentName(cFileSpec *this, const char *psz); // idb int __thiscall cFileSpec::MakeUnanchoredPath(cFileSpec *this); // idb -int __thiscall cFileSpec::MakeFullPath(cFileSpec *this, cFilePath *fp); +int __thiscall cFileSpec::MakeFullPath(cFileSpec *this, cFilePath *fp); // idb int __thiscall cFileSpec::GetFullPath(cFileSpec *this, cAnsiStr *Str, const cFilePath *fp); // idb int __thiscall cFileSpec::GetAnchoredPath(cFileSpec *this, cAnsiStr *Str); // idb int __thiscall cFileSpec::MakeAnchoredPath(cFileSpec *this); // idb -int __thiscall cFileSpec::GetAnchoredPath(cFileSpec *this, cAnsiStr *Str, cFilePath *path); -int __thiscall cFileSpec::MakeAnchoredPath(cFileSpec *this, cFilePath *path); +int __thiscall cFileSpec::GetAnchoredPath(cFileSpec *this, cAnsiStr *Str, cFilePath *path); // idb +int __thiscall cFileSpec::MakeAnchoredPath(cFileSpec *this, cFilePath *path); // idb // void __thiscall sFileDesc::sFileDesc(sFileDesc *this, char *pns, eFileSpecKind k); idb char *__cdecl _FilespecStrdup(const char *pszSource); // void __thiscall sFileDesc::sFileDesc(sFileDesc *this); idb @@ -47445,7 +47445,7 @@ int __thiscall cPathSplitter::GetDirectoryLen(cPathSplitter *this); // idb void __thiscall cFilePath::~cFilePath(cFilePath *this); // idb const cFilePath *__cdecl cFileSpec::GetAnchorPath(); // idb int __thiscall cFilePath::IsEmpty(cFilePath *this); // idb -int __thiscall cFilePath::ComputeAnchoredPath(cFilePath *this, cFilePath *targetDir, cAnsiStr *relPath); +int __thiscall cFilePath::ComputeAnchoredPath(cFilePath *this, cFilePath *targetDir, cAnsiStr *relPath); // idb const char *__thiscall cFilePath::GetPathName(cFilePath *this); // idb int __cdecl cHashHelperFunctions::hashlog2(int x); // idb int __cdecl cHashHelperFunctions::expmod(int b, int e, unsigned int m); // idb @@ -47471,12 +47471,12 @@ BOOL __thiscall cFilePath::CreatePath(cFilePath *this); void __thiscall cFilePath::FromText(cFilePath *this, const char *pPath); // idb void __thiscall cFilePath::AsText(cFilePath *this, cAnsiStr *str); // idb int __thiscall cFilePath::SetCurrentPath(cFilePath *this); // idb -int __thiscall cFilePath::AddRelativePath(cFilePath *this, cFilePath *relPath); +BOOL __thiscall cFilePath::AddRelativePath(cFilePath *this, cFilePath *relPath); int __thiscall cFilePath::MakeFullPath(cFilePath *this); // idb int __thiscall cFilePath::ToStream(cFilePath *this, struct cOStore *OStore); // idb int __thiscall cFilePath::FromStream(cFilePath *this, struct cIStore *IStore); // idb BOOL __thiscall cFilePath::operator==(cFilePath *this, cFilePath *FilePath); -int __thiscall sFindContext::DoFindFirst(sFindContext *this, sFindContext::tFindState WhatToFind, cAnsiStr *StrSpec, cAnsiStr *StrResult); +int __thiscall sFindContext::DoFindFirst(sFindContext *this, sFindContext::tFindState WhatToFind, cAnsiStr *StrSpec, cAnsiStr *StrResult); // idb int __thiscall sFindContext::DoFindNext(sFindContext *this, cAnsiStr *StrResult); // idb int __thiscall cFilePath::FindFirst(cFilePath *this, cFileSpec *fs, sFindContext *FC); // idb int __thiscall cFilePath::FindFirst(cFilePath *this, cFileSpec *fs, sFindContext *FC, const char *pWildcard); // idb @@ -47499,7 +47499,7 @@ int __thiscall cFilePath::GetFullPath(cFilePath *this, cAnsiStr *FullPath); // i BOOL __thiscall cFilePath::IsRelativePath(cFilePath *this); BOOL __cdecl cFilePath::IsRelativePath(const char *p); BOOL __cdecl IsRelativePath(const char *p); -int __thiscall cFilePath::ReducePathDots(cFilePath *this); // idb +BOOL __thiscall cFilePath::ReducePathDots(cFilePath *this); BOOL __cdecl cFilePath::ReduceDots(char *p); BOOL __cdecl operator==(cAnsiStr *s1, cAnsiStr *s2); int __thiscall cPathSplitter::GetDrive(cPathSplitter *this, cAnsiStr *nes); // idb @@ -47515,7 +47515,7 @@ void __cdecl NormalizePathStr(cAnsiStr *str); // idb BOOL __cdecl IsFullPath(const char *p); BOOL __cdecl IsDriveRelativePath(const char *p); void __cdecl SplitPath(const char *pszSourcePath, char *driveP, char *dirP, char *nameP, char *extP); // idb -void __stdcall CopyIt(char *dst, const char *src, unsigned int maxlen); // idb +void __stdcall CopyIt(char *dst, const char *src, size_t maxlen); int __stdcall DotFound(char *pB); // idb int __thiscall cPathSplitter::DoSplitTo(cPathSplitter *this, cPathSplitter::eComponent __formal); // idb BOOL __cdecl DotPathFound(const char *p, const char *pLeftLimit); @@ -47547,7 +47547,7 @@ unsigned int __stdcall cComplexAggregateControlWrapper::cComplexAggregateControl IAggregateMemberControl *__stdcall _CreateComplexAggregateControl(IUnknown *pAggregateMember, void (__stdcall *pfnOnFinalRelease)(IUnknown *), int (__stdcall *pfnConnect)(IUnknown *), int (__stdcall *pfnPostConnect)(IUnknown *), int (__stdcall *pfnInit)(IUnknown *), int (__stdcall *pfnEnd)(IUnknown *), int (__stdcall *pfnDisconnect)(IUnknown *)); // idb void __thiscall cGenericAggregate::cGenericAggregate(cGenericAggregate *this, const char *pszName, int __formal); // idb void __thiscall cGenericAggregate::~cGenericAggregate(cGenericAggregate *this); // idb -int __stdcall cGenericAggregate::QueryInterface(cGenericAggregate *this, _GUID *id, void **ppReturn); +int __stdcall cGenericAggregate::QueryInterface(cGenericAggregate *this, const _GUID *id, void **ppReturn); // idb unsigned int __stdcall cGenericAggregate::AddRef(cGenericAggregate *this); // idb unsigned int __stdcall cGenericAggregate::Release(cGenericAggregate *this); // idb int __stdcall cGenericAggregate::Add(cGenericAggregate *this, const sAggAddInfo *pAddInfo, unsigned int nAdd); // idb @@ -47614,7 +47614,7 @@ void __thiscall sPriIntInfo::sPriIntInfo(sPriIntInfo::cDynArray_(cDynArray_ *this); // idb void __thiscall cIPtr::cIPtr(cIPtr *this, const _GUID *id, IUnknown *pUnknownFrom); // idb tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, cInterfaceInfo *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, _GUID *key); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const _GUID *key); void __thiscall cDABase>::~cDABase>(cDABase> *this); // idb // unsigned int __thiscall cDABase>::Size(cDABase> *this); idb void __thiscall cDABase>::Sort(cDABase> *this, int (__cdecl *pfnCompare)(sPriGuidSetEntry *const *, sPriGuidSetEntry *const *)); // idb @@ -47664,7 +47664,7 @@ cInterfaceInfo *__thiscall cDList::GetLast(cDList::Remove(cHashSet *this, cInterfaceInfo *node); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb tHashSetNode__ *__thiscall cHashSet::GetFirst(cHashSet *this, tHashSetHandle *Handle); -int __thiscall cHashSet::IsEqual(cHashSet *this, _GUID *k1, _GUID *k2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb // int __cdecl cHashFunctions::IsEqual(const _GUID *p1, const _GUID *p2); idb unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb unsigned int __cdecl cHashFunctions::Hash(const _GUID *p); // idb @@ -47691,7 +47691,7 @@ const char *__stdcall cWindowsApplication::cWinAppOperations::GetRegistryKey(cWi void __stdcall cWindowsApplication::cWinAppOperations::SetProfileName(cWindowsApplication::cWinAppOperations *this, const char *__formal); // idb const char *__stdcall cWindowsApplication::cWinAppOperations::GetProfileName(cWindowsApplication::cWinAppOperations *this); // idb void __stdcall cWindowsApplication::cWinAppOperations::SetDialogBkColor(cWindowsApplication::cWinAppOperations *this, unsigned int clrCtlBk, unsigned int clrCtlText); // idb -int __thiscall cWindowsApplication::cWinAppOperations::DispatchOneMessage(cWindowsApplication::cWinAppOperations *this, tagMSG *pMsg, unsigned int nFilterMin, unsigned int nFilterMax); +int __thiscall cWindowsApplication::cWinAppOperations::DispatchOneMessage(cWindowsApplication::cWinAppOperations *this, tagMSG *pMsg, UINT nFilterMin, UINT nFilterMax); eWinPumpResult __stdcall cWindowsApplication::cWinAppOperations::PumpEvents(cWindowsApplication::cWinAppOperations *this, int fPumpKind, eWinPumpDuration fDuration); // idb int __thiscall cWindowsApplication::cWinAppOperations::PreTranslateMessage(cWindowsApplication::cWinAppOperations *this, tagMSG *pMsg); // idb int __stdcall cWindowsApplication::cWinAppOperations::ModalDialogBox(cWindowsApplication::cWinAppOperations *this, const char *lpTemplate, int (__stdcall *lpDialogFunc)(HWND__ *, unsigned int, unsigned int, int)); // idb @@ -47880,8 +47880,8 @@ int __cdecl com_init(); int __cdecl com_close(); int __cdecl com_set_mode(int mode, int clear); // idb int __cdecl com_get_mode(); // idb -void __cdecl com_set_pal(int start, int n, unsigned __int8 *pal); // idb -void __cdecl com_get_pal(int start, int n, unsigned __int8 *pal); // idb +void __cdecl com_set_pal(unsigned int start, unsigned int n, unsigned __int8 *pal); +void __cdecl com_get_pal(unsigned int start, unsigned int n, unsigned __int8 *pal); int __cdecl com_set_width(int w); // idb void __cdecl com_set_focus(int x, int y); // idb void __cdecl com_get_focus(int *x, int *y); // idb @@ -48231,7 +48231,7 @@ __int16 __cdecl gr_font_string_nwidth(grs_font *f, const char *s, int n); // idb __int16 __cdecl gr_font_string_nheight(grs_font *f, const char *s, int n); // idb void __cdecl gr_font_string_nsize(grs_font *f, const char *s, __int16 *w, __int16 *h, int n); // idb __int16 __cdecl gr_font_char_width(grs_font *f, unsigned __int8 c); -void __cdecl gr_font_char_size(grs_font *f, unsigned __int8 c, __int16 *w, __int16 *h); +void __cdecl gr_font_char_size(grs_font *f, char c, __int16 *w, __int16 *h); // idb int __cdecl gr_font_string_wrap(grs_font *pfont, char *ps, __int16 width); // idb void __cdecl gr_font_string_unwrap(char *s); // idb void __cdecl font_setup(grs_font_info *fi, grs_font *f); // idb @@ -48468,7 +48468,7 @@ void __thiscall cDDModeOpsBase::~cDDModeOpsBase(cDDModeOpsBase *this); // idb int __thiscall cDDModeOpsBase::DoSetPalette(cDDModeOpsBase *this, tagLOGPALETTE *logicalPalette, unsigned int uStart, unsigned int n); // idb void __thiscall cDDModeOpsBase::GetSurfaces(cDDModeOpsBase *this, IDirectDrawSurface4 **ppPrimarySurface, IDirectDrawSurface4 **ppSecondarySurface); // idb void __thiscall cDDModeOpsBase::SetClipToWindow(cDDModeOpsBase *this, int fWantClipping); // idb -void __thiscall cDDModeOpsBase::SetModeInfoFromSurfaceDesc(cDDModeOpsBase *this, const _DDSURFACEDESC2 *renderTargetDesc, int flags, grs_drvcap *pReturnModeInfo); // idb +void __thiscall cDDModeOpsBase::SetModeInfoFromSurfaceDesc(cDDModeOpsBase *this, const _DDSURFACEDESC2 *renderTargetDesc, unsigned int flags, grs_drvcap *pReturnModeInfo); int __thiscall cDDModeOpsBase::WipeSurface(cDDModeOpsBase *this, IDirectDrawSurface4 *pdds); // idb BOOL __thiscall cDDModeOpsBase::DoSetGamma(cDDModeOpsBase *this, double gamma); void __thiscall cDirectDDModeOps::~cDirectDDModeOps(cDirectDDModeOps *this); // idb @@ -48508,7 +48508,7 @@ void __cdecl config_parse_line(char *buf, char **var, char **val, char **com); / __int16 __cdecl config_init(); // idb __int16 __cdecl config_set_priority(const char *var, unsigned int priority); // idb unsigned int __cdecl config_get_priority(const char *var); // idb -__int16 __cdecl config_get_origin(const char *var, char *buf, int buflen); // idb +__int16 __cdecl config_get_origin(const char *var, char *buf, size_t buflen); __int16 __cdecl config_set_from_file(const char *var, char *val, unsigned int priority, _filename_rec *rec); // idb __int16 __cdecl config_read_file(const char *fn, unsigned int (__cdecl *readfunc)(char *)); // idb void __cdecl config_write_line(int fd, const char *var, char *val, char *com); // idb @@ -48520,7 +48520,7 @@ __int16 __cdecl config_set_value(const char *varname, int type, _DWORD *fillvec, __int16 __cdecl config_set_single_value(const char *varname, int type, const char *value); unsigned __int8 __cdecl config_get_value(const char *varname, int type, _DWORD *fillvec, int *cnt); bool __cdecl config_get_single_value(const char *varname, int type, void **value); -unsigned __int8 __cdecl config_get_raw(const char *varname, char *buf, int bufsize); // idb +unsigned __int8 __cdecl config_get_raw(const char *varname, char *buf, size_t bufsize); int __cdecl config_get_raw_all_iter(_config_elem *e, _config_iter_rawall_struct *iter); void __cdecl config_get_raw_all(unsigned __int8 (__cdecl *ifunc)(char *), char *buf, int bufsize); // idb void __cdecl config_set_assign_characters(char *str); // idb @@ -48654,7 +48654,7 @@ tHashSetNode__ *__thiscall cHashSet:: tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, sRSCItemTag *key); tHashSetNode__ *__thiscall cHashSet::Remove(cHashSet *this, sRSCItem *node); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb -BOOL __thiscall cHashSet::IsEqual(cHashSet *this, sRSCItemTag *k1, sRSCItemTag *k2); +BOOL __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); BOOL __cdecl cRSCItemHashFunc::IsEqual(const sRSCItemTag *p1, const sRSCItemTag *p2); unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb unsigned int __cdecl cRSCItemHashFunc::Hash(const sRSCItemTag *p); // idb @@ -48696,7 +48696,7 @@ int __cdecl ResOpenResFile(char *fname, ResOpenMode mode, unsigned __int8 auxinf void __cdecl ResCloseFile(int filenum); // idb int __cdecl ResFindFreeFilenum(); // idb void __cdecl ResReadDirEntries(int filenum, ResDirHeader *pDirHead, char add_flags); -void __cdecl ResProcDirEntry(ResDirEntry *pDirEntry, int filenum, int dataOffset, char add_flags); +void __cdecl ResProcDirEntry(ResDirEntry *pDirEntry, int filenum, unsigned int dataOffset, char add_flags); void __cdecl ResReadEditInfo(ResFile *prf); // idb void __cdecl ResReadDir(ResFile *prf, int filenum); // idb void __cdecl ResCreateEditInfo(ResFile *prf, int filenum); // idb @@ -48739,7 +48739,7 @@ void __cdecl PkImplodeWrite(char *buf, unsigned int *size, void *param); // idb int __cdecl PkImplodeMemToMem(const unsigned __int8 *pSource, unsigned int sizeSource, unsigned __int8 *pDest, int destMax); size_t __cdecl PkExplodeRead(char *buf, unsigned int *size, void *param); void __cdecl PkExplodeWrite(char *buf, unsigned int *size, void *param); // idb -int __cdecl PkExplodeFileToMem(IStoreStream *fdSource, char *pDest, int skip, int destMax); +int __cdecl PkExplodeFileToMem(IStoreStream *fdSource, char *pDest, unsigned int skip, int destMax); void __thiscall __cDynFunc__implode::~__cDynFunc__implode(__cDynFunc__implode *this); // idb void __thiscall __cDynFunc__explode::~__cDynFunc__explode(__cDynFunc__explode *this); // idb unsigned int (__cdecl *__thiscall __cDynFunc__implode::GetProcAddress(__cDynFunc__implode *this))(unsigned int (__cdecl *)(char *, unsigned int *, void *), void (__cdecl *)(char *, unsigned int *, void *), char *, void *, unsigned int *, unsigned int *); // idb @@ -48770,7 +48770,7 @@ int LzwFpSrcGet(); int __cdecl LzwBuffDestCtrl(int a1, int a2); int __cdecl LzwBuffDestPut(char a1); int __cdecl LzwFdDestCtrl(int a1, int a2); -int __cdecl LzwFdDestPut(char a1); +unsigned int __cdecl LzwFdDestPut(char a1); FILE *__cdecl LzwFpDestCtrl(FILE *a1, FILE *a2); int __cdecl LzwFpDestPut(unsigned __int8 a1); int __cdecl LzwFindMatch(int a1, unsigned int a2); // idb @@ -48828,7 +48828,7 @@ BOOL __thiscall cFixedMTQueue<_lgMouseEvent,32>::IsEmpty(cFixedMTQueue<_lgMouseE void __thiscall cAutoLock::cAutoLock(cAutoLock *this, cThreadLock *lock); // idb void __thiscall cAutoLock::~cAutoLock(cAutoLock *this); // idb void __thiscall cFixedMTQueue<_lgMouseEvent,32>::Flush(cFixedMTQueue<_lgMouseEvent,32> *this); // idb -BOOL __thiscall cFixedMTQueue<_lgMouseEvent,32>::Add(cFixedMTQueue<_lgMouseEvent,32> *this, const _lgMouseEvent *pAdd); +int __thiscall cFixedMTQueue<_lgMouseEvent,32>::Add(cFixedMTQueue<_lgMouseEvent,32> *this, const _lgMouseEvent *pAdd); // idb BOOL __thiscall cThreadEvent::Set(cThreadEvent *this); void __thiscall cThreadSyncObject::AssertUseable(cThreadSyncObject *this); // idb int __thiscall cFixedMTQueue<_lgMouseEvent,32>::GetNext(cFixedMTQueue<_lgMouseEvent,32> *this, _lgMouseEvent *pReturn); // idb @@ -48841,7 +48841,7 @@ void __thiscall cFixedMTQueue<_lgMouseEvent,32>::Unlock(cFixedMTQueue<_lgMouseEv void __thiscall cFixedQueue<_lgMouseEvent,32>::cFixedQueue<_lgMouseEvent,32>(cFixedQueue<_lgMouseEvent,32> *this); // idb BOOL __thiscall cFixedQueue<_lgMouseEvent,32>::IsEmpty(cFixedQueue<_lgMouseEvent,32> *this); // void __thiscall cFixedQueue<_lgMouseEvent,32>::Flush(cFixedQueue<_lgMouseEvent,32> *this); idb -BOOL __thiscall cFixedQueue<_lgMouseEvent,32>::Add(cFixedQueue<_lgMouseEvent,32> *this, const _lgMouseEvent *pAdd); +int __thiscall cFixedQueue<_lgMouseEvent,32>::Add(cFixedQueue<_lgMouseEvent,32> *this, const _lgMouseEvent *pAdd); // idb int __thiscall cFixedQueue<_lgMouseEvent,32>::GetNext(cFixedQueue<_lgMouseEvent,32> *this, _lgMouseEvent *pReturn); // idb int __thiscall cFixedQueue<_lgMouseEvent,32>::PeekNext(cFixedQueue<_lgMouseEvent,32> *this, _lgMouseEvent *pReturn); // idb BOOL __thiscall cFixedQueue<_lgMouseEvent,32>::IsFull(cFixedQueue<_lgMouseEvent,32> *this); @@ -49041,7 +49041,7 @@ void __thiscall cWinGameShell::OnQuit(cWinGameShell *this); // idb void __thiscall cWinGameShell::NotifyDisplayOnActivateApp(cWinGameShell *this, int fActive); // idb void __thiscall cWinGameShell::OnActivateApp(cWinGameShell *this, int fActive); // idb LRESULT __stdcall cWinGameShell::StaticWndProc(HWND__ *hwnd, unsigned int msg, unsigned int wParam, int lParam); -void __thiscall cWinGameShell::DoPumpEvents(cWinGameShell *this, int fPumpFlags, int fDuration); +void __thiscall cWinGameShell::DoPumpEvents(cWinGameShell *this, int fPumpFlags, eWinPumpDuration fDuration); // idb int __thiscall cWinGameShell::PreTranslateMessage(cWinGameShell *this, tagMSG *pMsg); // idb int __thiscall cWinGameShell::WndProc(cWinGameShell *this, unsigned int msg, char *wParam, int lParam); int __stdcall cWinGameShell::cWinAppAdviseSink::QueryInterface(cWinGameShell::cWinAppAdviseSink *this, const _GUID *id, void **ppI); // idb @@ -49176,14 +49176,14 @@ void __cdecl RndGauss16Seed(RndStream_ *prs, unsigned int seed); // idb int __cdecl RndGauss16Fast(RndStream_ *prs); void __cdecl RndGauss16FastSeed(RndStream_ *prs, unsigned int seed); // idb unsigned int __cdecl high_umpy(unsigned int a, unsigned int b); // idb -int __stdcall _RecorderCreate(const _GUID *__formal, IRecorder **a2, IUnknown *pOuterUnknown, sHashSetChunk **mode, const char *pszRecFilepath, const char *pszRecFileName, unsigned int fSaveOption); +int __stdcall _RecorderCreate(const _GUID *__formal, IRecorder **a2, IUnknown *pOuterUnknown, sHashSetChunk **mode, const char *pszRecFilepath, const char *pszRecFileName, eRecSaveOption fSaveOption); int __stdcall cRecorder::QueryInterface(cRecorder *this, const _GUID *id, void **ppI); // idb int __stdcall cRecorder::AddRef(cRecorder *this); int __stdcall cRecorder::Release(cRecorder *this); int __stdcall cRecorder::cSimpleAggregateControl::QueryInterface(cRecorder::cSimpleAggregateControl *this, const _GUID *id, void **ppI); // idb unsigned int __stdcall cRecorder::cSimpleAggregateControl::AddRef(cRecorder::cSimpleAggregateControl *this); // idb unsigned int __stdcall cRecorder::cSimpleAggregateControl::Release(cRecorder::cSimpleAggregateControl *this); // idb -void __thiscall cRecorder::cRecorder(cRecorder *this, IUnknown *pOuterUnknown, sHashSetChunk **mode, const char *pszRecFilepath, const char *pszRecFileName, unsigned int fSaveOption); +void __thiscall cRecorder::cRecorder(cRecorder *this, IUnknown *pOuterUnknown, sHashSetChunk **mode, const char *pszRecFilepath, const char *pszRecFileName, eRecSaveOption fSaveOption); void __thiscall cRecorder::~cRecorder(cRecorder *this); // idb sHashSetChunk **__stdcall cRecorder::GetMode(cRecorder *this); int __stdcall cRecorder::StreamAddOrExtract(cRecorder *this, void *pData, unsigned int sizeData, char *pszTypeTag); @@ -49272,8 +49272,8 @@ unsigned __int8 __cdecl region_test_rect(_Region *reg, Rect *r); // idb int __cdecl hotkey_hash_func(unsigned __int16 *v); int __cdecl hotkey_equ_func(unsigned __int16 *v1, unsigned __int16 *v2); __int16 __cdecl hotkey_init(int tblsize); // idb -__int16 __cdecl hotkey_add(__int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *), void *state); // idb -__int16 __cdecl hotkey_add_help(__int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *), void *state, char *help_text); // idb +__int16 __cdecl hotkey_add(unsigned __int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *), void *state); +__int16 __cdecl hotkey_add_help(unsigned __int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *), void *state, char *help_text); char *__cdecl hotkey_help_text(__int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *)); // idb __int16 __cdecl hotkey_remove(__int16 keycode, unsigned int contexts, unsigned __int8 (__cdecl *func)(__int16, unsigned int, void *)); // idb __int16 __cdecl hotkey_replace(__int16 keycode, unsigned int old_contexts, unsigned __int8 (__cdecl *old_func)(__int16, unsigned int, void *), void *old_state, unsigned int new_contexts, unsigned __int8 (__cdecl *new_func)(__int16, unsigned int, void *), void *new_state); // idb @@ -49323,7 +49323,7 @@ __int16 __cdecl uiInstallRegionHandler(_Region *r, unsigned int evmask, unsigned __int16 __cdecl uiRemoveRegionHandler(_Region *r, int id); // idb __int16 __cdecl uiSetRegionHandlerMask(_Region *r, int id, int evmask); // idb unsigned int __cdecl uiGetRegionOpacity(_Region *reg); // idb -__int16 __cdecl uiSetRegionOpacity(_Region *reg, int mask); +__int16 __cdecl uiSetRegionOpacity(_Region *reg, unsigned int mask); // idb __int16 __cdecl uiGrabSlabFocus(_ui_slab *slab, _Region *r, unsigned int evmask); // idb __int16 __cdecl uiGrabFocus(_Region *r, unsigned int evmask); // idb __int16 __cdecl uiReleaseSlabFocus(_ui_slab *slab, _Region *r, unsigned int evmask); // idb @@ -49386,7 +49386,7 @@ __int16 __cdecl TextGadgUpdate(_TextGadg *gadg); // idb __int16 __cdecl TextGadgFocus(_TextGadg *gadg); // idb __int16 __cdecl TextGadgUnfocus(_TextGadg *gadg); // idb int __cdecl LGadSetCursor(grs_bitmap *bm, Point anchor, int paltype, _cursor *c); // idb -void __cdecl lgad_set_pal16(int paltype, int align); // idb +void __cdecl lgad_set_pal16(int paltype, unsigned int align); int __cdecl LGadPushCursor(IDataSource *pCurs, Point anchor, int paltype); // idb int __cdecl LGadPopCursor(); // idb int __cdecl LGadFlush(); // idb @@ -49424,7 +49424,7 @@ int __cdecl LGadEraseBox(_LGadBox *vb, unsigned __int8 free_self); // idb void __cdecl ButtonDraw(void *data, _LGadBox *vb); // idb void __cdecl LGadComputeSize(LGadButton *vbutt, __int16 *wp, __int16 *hp); // idb void __cdecl LGadInitButton(LGadButton *vb); // idb -LGadButton *__cdecl LGadCreateButtonArgs(LGadButton *vb, _LGadRoot *vr, __int16 x, __int16 y, __int16 w, __int16 h, _DrawElement *draw, unsigned __int8 (__cdecl *bfunc)(__int16, void *, _LGadBox *), char paltype); // idb +LGadButton *__cdecl LGadCreateButtonArgs(LGadButton *vb, _LGadRoot *vr, unsigned __int16 x, unsigned __int16 y, __int16 w, __int16 h, _DrawElement *draw, unsigned __int8 (__cdecl *bfunc)(__int16, void *, _LGadBox *), char paltype); unsigned __int8 __cdecl button_signal_handler(_ui_event *uiev, _Region *reg); void __cdecl LGadComputeVarSize(LGadButton *vt, __int16 *wp, __int16 *hp); unsigned __int8 __cdecl ToggleMouseHandler(__int16 x, __int16 y, __int16 action, __int16 wheel, _LGadBox *vb); // idb @@ -49434,7 +49434,7 @@ LGadToggle *__cdecl LGadCreateToggleArgs(LGadToggle *vt, _LGadRoot *vr, __int16 unsigned __int8 __cdecl ScaleMotionHandler(__int16 x, __int16 y, LGadScale *vb); unsigned __int8 __cdecl ScaleMouseHandler(__int16 x, __int16 y, __int16 action, __int16 wheel, LGadScale *vb); void __cdecl ScaleDrawCallback(_DrawElement *elem); -int __cdecl get_color(_LGadBox *vb, int stylecol, unsigned int override); +int __cdecl get_color(_LGadBox *vb, unsigned int stylecol, unsigned int override); void __cdecl ScaleDraw(void *data, LGadScale *vb); void __cdecl LGadInitScale(LGadButton *vs); LGadScale *__cdecl LGadCreateScale(LGadScale *vs, _LGadRoot *vr, __int16 x, __int16 y, __int16 w, __int16 h, char paltype); // idb @@ -49443,12 +49443,12 @@ void __cdecl LGadInitMenu(LGadButton *vm); void __cdecl LGadMenuSaveunder(_LGadMenu *vm); // idb void __cdecl MenuElemSize(_LGadMenu *vm, __int16 *pw, __int16 *ph); // idb void __cdecl MenuDrawCallback(_DrawElement *elem); -int __cdecl get_color_default(_LGadBox *vb, int stylecol, unsigned int def); +unsigned int __cdecl get_color_default(_LGadBox *vb, unsigned int stylecol, unsigned int def); // idb bool __cdecl MenuMouseHandler(__int16 x, __int16 y, __int16 action, __int16 wheel, _LGadMenu *vb); void __cdecl defer_menu_destroy(_LGadMenu *menu); // idb // void __cdecl do_deferred_menu_destroy(void *_menu); idb void __cdecl menu_undraw(_LGadMenu *vm); // idb -bool __cdecl MenuMotionHandler(__int16 x, __int16 y, _LGadMenu *vb); +bool __cdecl MenuMotionHandler(unsigned __int16 x, unsigned __int16 y, _LGadMenu *vb); unsigned __int8 __cdecl MenuKeyHandlerInternal(__int16 keycode, _LGadMenu *vb, unsigned __int8 default_retval); unsigned __int8 __cdecl MenuKeyHandler(__int16 keycode, _LGadMenu *vb); void __cdecl LGadMenuComputeSize(__int16 *w, __int16 *h, __int16 num_elems, __int16 vis_elems, unsigned int flags, _DrawElement *elems, unsigned __int16 draw_flags, __int16 extra_w, __int16 extra_h); @@ -49479,7 +49479,7 @@ _LGadButtonList *__cdecl LGadCreateButtonListDesc(_LGadButtonList *list, _LGadRo void __cdecl LGadDestroyButtonList(_LGadButtonList *list); // idb void __cdecl SetTheGUImethods(_GUImethods *gm); // idb _GUImethods *__cdecl TheGUImethods(); // idb -void __cdecl GUIsetup(_GUIcompose *c, Rect *area, int flags, int canvtype); // idb +void __cdecl GUIsetup(_GUIcompose *c, Rect *area, GUIcomposeFlags flags, int canvtype); void __cdecl GUIsetpal(_GUIcompose *c, unsigned int pal); // idb void __cdecl GUIclear(_GUIcompose *c, Rect *r); // idb void __cdecl GUIdone(_GUIcompose *c); // idb @@ -49554,8 +49554,8 @@ void __cdecl __noreturn UtilDrawBitmapRef(unsigned int bmap_id); grs_canvas *__cdecl UtilScreen(__int16 action); // idb void UtilClearCliprect(); unsigned __int16 *__cdecl UtilGetPalConv(int palref); -void __cdecl UtilSetPalConv(int palref); -void __cdecl UtilSetPalConvList(int palref, int n); +void __cdecl UtilSetPalConv(unsigned int palref); // idb +void __cdecl UtilSetPalConvList(unsigned int palref, unsigned int n); void __cdecl UtilClearPalConv(unsigned int palref); // idb void __cdecl UtilSetPal(unsigned int palref); // idb void __cdecl UtilSetCliprect(__int16 x1, __int16 y1, __int16 x2, __int16 y2); // idb @@ -49570,7 +49570,7 @@ unsigned int __stdcall cDSndMixer::AddRef(cDSndMixer *this); // idb unsigned int __stdcall cDSndMixer::Release(cDSndMixer *this); // idb void __thiscall cDSndMixer::cDSndMixer(cDSndMixer *this); // idb void __thiscall cDSndMixer::~cDSndMixer(cDSndMixer *this); // idb -int __stdcall cDSndMixer::Init(cDSndMixer *this, _sSndSetup *setup, int numChannels, _sSndAttribs *pAttribs); +int __stdcall cDSndMixer::Init(cDSndMixer *this, _sSndSetup *setup, unsigned int numChannels, _sSndAttribs *pAttribs); cDSndSample *__stdcall cDSndMixer::CreateRawSample(cDSndMixer *this, unsigned int flags, unsigned __int8 *pData, unsigned int dataLen, unsigned int nSamples, _sSndAttribs *pAttribs); void __stdcall cDSndMixer::Pause(cDSndMixer *this); // idb void __stdcall cDSndMixer::Resume(cDSndMixer *this); // idb @@ -49583,7 +49583,7 @@ void __stdcall cDSndMixer::Get3DMethodCapabilities(cDSndMixer *this, unsigned in void __stdcall cDSndMixer::Set3DDeferMode(cDSndMixer *this, int deferOn); // idb // IDirectSound *__thiscall cDSndMixer::GetDevice(cDSndMixer *this); idb void __stdcall cDSndMixer::FreeHWChannelCount(cDSndMixer *this, int *pHWChans, int *p3DHWChans); // idb -IDirectSound *__stdcall cDSndMixer::Kludge(cDSndMixer *this, int kludgeSelector, _DSCAPS *pKludgeStruct, int sizeKludgeStruct); +IDirectSound *__stdcall cDSndMixer::Kludge(cDSndMixer *this, int kludgeSelector, _DSCAPS *pKludgeStruct, unsigned int sizeKludgeStruct); BOOL __stdcall cDSndMixer::Init3DReverb(cDSndMixer *this); void __stdcall cDSndMixer::Shutdown3DReverb(cDSndMixer *this); // idb BOOL __stdcall cDSndMixer::Have3DReverb(cDSndMixer *this); @@ -49602,7 +49602,7 @@ cDSndMixer *__thiscall cDSndMixer::`vector deleting destructor'(cDSndMixer *this int (__stdcall *__thiscall __cDynFunc__DirectSoundCreate::GetProcAddress(__cDynFunc__DirectSoundCreate *this))(_GUID *, IDirectSound **, IUnknown *); // idb int (__stdcall *__thiscall __cDynFunc__A3dCreate::GetProcAddress(__cDynFunc__A3dCreate *this))(_GUID *, IDirectSound **, IUnknown *); // idb int __cdecl SndCrackRezHeader(void *pRezData, unsigned int rezLen, void **ppData, unsigned int *pDataLen, unsigned int *pNumSamples, _sSndAttribs *pAttribs); // idb -int __cdecl SndCrackWaveHeader(char *pRezData, int rezLen, void **ppData, unsigned int *pDataLen, unsigned int *pNumSamples, _sSndAttribs *pAttribs); +int __cdecl SndCrackWaveHeader(char *pRezData, unsigned int rezLen, void **ppData, unsigned int *pDataLen, unsigned int *pNumSamples, _sSndAttribs *pAttribs); int __cdecl openWaveHeader(HMMIO__ *hmmio, _MMIOINFO *pMmio, void **ppPCMData, unsigned int *pPCMLen, unsigned int *pNSamples, _sSndAttribs *pAttribs); // idb BOOL __cdecl SndCrackVocHeader(char *pRezData, unsigned int rezLen, void **ppData, unsigned int *pDataLen, unsigned int *pNumSamples, _sSndAttribs *pAttribs); void __thiscall __cDynFunc__DirectSoundCreate::__cDynFunc__DirectSoundCreate(__cDynFunc__DirectSoundCreate *this); // idb @@ -49635,7 +49635,7 @@ int __stdcall cSndMixer::SetMasterVolume(cSndMixer *this, int vol); // idb int __stdcall cSndMixer::GetMasterVolume(cSndMixer *this); // idb int __stdcall cSndMixer::SetGroupVolume(cSndMixer *this, unsigned int group, int vol); // idb int __stdcall cSndMixer::GetGroupVolume(cSndMixer *this, unsigned int group); // idb -void __stdcall cSndMixer::FadeGroupVolume(cSndMixer *this, unsigned int group, int newVolume, int time, _eSndFadeFlags flags); // idb +void __stdcall cSndMixer::FadeGroupVolume(cSndMixer *this, unsigned int group, int newVolume, unsigned int time, _eSndFadeFlags flags); void __stdcall cSndMixer::RegisterGroupFadeCallback(cSndMixer *this, unsigned int group, void (__cdecl *endFunc)(ISndSample *, void *), void *pCBData); // idb ISndSample *__stdcall cSndMixer::CreateSampleFromRez(cSndMixer *this, unsigned int flags, void *pRezData, unsigned int len); // idb int __thiscall cSndMixer::AllocChannel(cSndMixer *this, cSndSample *pSample, unsigned int __formal, eSnd3DMethod a4); // idb @@ -49664,7 +49664,7 @@ int __cdecl DistanceToMilliBels(int distance); // idb double __stdcall cSndMixer::Get3DDistanceFromVolume(cSndMixer *this, int vol); __int64 __stdcall cSndMixer::Get3DPositionVolume(cSndMixer *this, _sSndVector *pSrcPos); void __stdcall cSndMixer::Get3DPositionPanVolume(cSndMixer *this, _sSndVector *pSrcPos, int *pPan, int *pVol); // idb -void __stdcall cSndMixer::Set3DDeferMode(cSndMixer *this, int deferOn); // idb +void __stdcall cSndMixer::Set3DDeferMode(cSndMixer *this, unsigned int deferOn); int __stdcall cSndMixer::Kludge(cSndMixer *this, int __formal, void *a3, int a4); // idb void __stdcall cSndMixer::FreeHWChannelCount(cSndMixer *this, int *pHWChans, int *p3DHWChans); // idb int __stdcall cSndMixer::Have3DOcclusion(cSndMixer *this); // idb @@ -49688,7 +49688,7 @@ void __thiscall cThreadMutex::~cThreadMutex(cThreadMutex *this); // idb // cSndSample *__thiscall cSndSample::Next(cSndSample *this); idb // unsigned int __thiscall cSndSample::GetGroupQuick(cSndSample *this); idb void __thiscall cMixerAutoLock::cMixerAutoLock(cMixerAutoLock *this, cThreadMutex *mutex); // idb -BOOL __thiscall cThreadSyncObject::Wait(cThreadSyncObject *this, unsigned int dwTimeout); +BOOL __thiscall cThreadSyncObject::Wait(cThreadSyncObject *this, DWORD dwTimeout); void __thiscall cMixerAutoLock::~cMixerAutoLock(cMixerAutoLock *this); // idb // unsigned int __thiscall cSndSample::GetFlags(cSndSample *this); idb BOOL __thiscall cSndSample::IsStream(cSndSample *this); @@ -49736,13 +49736,13 @@ unsigned int __stdcall cSndSample::GetSerialNumber(cSndSample *this); // idb unsigned int __stdcall cSndSample::GetGroup(cSndSample *this); // idb void __stdcall cSndSample::GetAttribs(cSndSample *this, _sSndAttribs *pAttribs); // idb _eSndError __stdcall cSndSample::LoadBuffer(cSndSample *this, unsigned __int8 *data, unsigned int len); // idb -void *__cdecl memCopyFunk(void *pSrcData, void *pDstData, unsigned int numBytes); // idb +void *__cdecl memCopyFunk(void *pSrcData, void *pDstData, size_t numBytes); void __stdcall __noreturn cSndSample::Squelch(cSndSample *this, int __formal, unsigned int a3, _eSndSquelchMode a4); __int64 __stdcall cSndSample::SamplesToTime(cSndSample *this, unsigned int samples); __int64 __stdcall cSndSample::TimeToSamples(cSndSample *this, unsigned int milliSeconds); cSndFadeTask *__thiscall cSndSample::GetFader(cSndSample *this, _eSndFaders whichFader); // idb BOOL __stdcall cSndSample::FadeActive(cSndSample *this, _eSndFaders whichFader); -void __stdcall cSndSample::Fade(cSndSample *this, _eSndFaders whichFader, int destVal, int time, _eSndFadeFlags flags); // idb +void __stdcall cSndSample::Fade(cSndSample *this, _eSndFaders whichFader, int destVal, unsigned int time, _eSndFadeFlags flags); void __thiscall cSndSample::MoveToList(cSndSample *this, cSndSample **ppHead); // idb void __thiscall cSndSample::RemoveFromList(cSndSample *this); // idb void __stdcall cSndSample::RegisterFillCallback(cSndSample *this, void (__cdecl *newCB)(ISndSample *, void *, unsigned int), void *pCBData); // idb @@ -49840,7 +49840,7 @@ void __thiscall cSndVolumeFadeTask::SetNextValue(cSndVolumeFadeTask *this, int v int __thiscall cSndVolumeFadeTask::GetCurrentValue(cSndVolumeFadeTask *this); // idb void __thiscall cSndPanFadeTask::SetNextValue(cSndPanFadeTask *this, int val); // idb int __thiscall cSndPanFadeTask::GetCurrentValue(cSndPanFadeTask *this); // idb -void __thiscall cSndFrequencyFadeTask::SetNextValue(cSndFrequencyFadeTask *this, int val); // idb +void __thiscall cSndFrequencyFadeTask::SetNextValue(cSndFrequencyFadeTask *this, unsigned int val); unsigned int __thiscall cSndFrequencyFadeTask::GetCurrentValue(cSndFrequencyFadeTask *this); void __thiscall cSndFadeTask::FadeEndStop(cSndFadeTask *this); // idb int __thiscall cSndFadeTask::DoFadeStep(cSndFadeTask *this); // idb @@ -49877,7 +49877,7 @@ int __thiscall cActiveMoviePlayer1::SubstituteLGRenderer(cActiveMoviePlayer1 *th int __stdcall cActiveMoviePlayer1::Open(cActiveMoviePlayer1 *this, const char *pszName, int xOrig, int yOrig, int width, int height); // idb void __stdcall cActiveMoviePlayer1::Close(cActiveMoviePlayer1 *this); // idb BOOL __stdcall cActiveMoviePlayer1::CanPlay(cActiveMoviePlayer1 *this); -int __stdcall cActiveMoviePlayer1::Play(cActiveMoviePlayer1 *this, int flags); // idb +int __stdcall cActiveMoviePlayer1::Play(cActiveMoviePlayer1 *this, unsigned int flags); int __stdcall cActiveMoviePlayer1::Pause(cActiveMoviePlayer1 *this); // idb int __stdcall cActiveMoviePlayer1::Stop(cActiveMoviePlayer1 *this); // idb BOOL __stdcall cActiveMoviePlayer1::GetVolume(cActiveMoviePlayer1 *this, int *pOutVol); @@ -49900,7 +49900,7 @@ void __stdcall cActiveMovieDraw::GetSourceRect(cActiveMovieDraw *this, tagRECT * void __thiscall cActiveMovieDraw::SetStretchMode(cActiveMovieDraw *this); // idb int __thiscall cActiveMovieDraw::CheckVideoType(cActiveMovieDraw *this, const tagVIDEOINFO *pInput); // idb $708CE63512FA93C279F3C666A3618574 *__thiscall cActiveMovieDraw::GetBitMasks(cActiveMovieDraw *this, const tagVIDEOINFO *pVideoInfo); -int __stdcall cActiveMovieDraw::CheckMediaType(cActiveMovieDraw *this, CMediaType *pmtIn); +int __stdcall cActiveMovieDraw::CheckMediaType(cActiveMovieDraw *this, const CMediaType *pmtIn); // idb int __stdcall cActiveMovieDraw::NotifyMediaType(cActiveMovieDraw *this, CMediaType *pmt); // idb int __stdcall cActiveMovieDraw::GetMediaType(cActiveMovieDraw *this, int iPosition, CMediaType *pmt); // idb BOOL __stdcall cActiveMovieDraw::GetAllocator(cActiveMovieDraw *this, IMemAllocator **ppAllocator); @@ -49958,7 +49958,7 @@ void __thiscall cIPtr::cIPtr(cIPtr::cIPtr(cIPtr *this, IRecorder *pUnknownInit); // idb int __stdcall GetLGVideoRenderer(); // idb int __cdecl SetLGVidRegistryEntries(const char *pszFilterFilename); // idb -int __cdecl RegCreateAndSet(HKEY__ *hKey, const char *pszSubkey, const char *pszValueName, unsigned int fdwType, const char *pData, unsigned int cbData); +int __cdecl RegCreateAndSet(HKEY__ *hKey, const char *pszSubkey, const char *pszValueName, DWORD fdwType, const char *pData, DWORD cbData); unsigned int CleanLGVidRegistryEntries(); int __stdcall ReleaseLGVideoRenderer(); // idb int __cdecl CheckBitFields(const struct tagVIDEOINFO *a1); // idb @@ -49975,7 +49975,7 @@ unsigned int __cdecl BitmapFlagsFromBMIHeader(const struct tagBITMAPINFOHEADER * unsigned int __cdecl gr_bitmap_type_count(struct grs_bitmap *a1); // idb void __cdecl AMBlitFlipped16to16(unsigned __int8 *a1, int n, int a3, unsigned __int8 *a4, int a5, int a6, int a7, int a8, int a9); // idb void __cdecl AMBlitFlipped16to16x2(unsigned __int8 *a1, int a2, int a3, unsigned __int8 *a4, int a5, int a6, int a7, int a8, int a9, char a10); // idb -void __cdecl AMBlit(unsigned __int8 *a1, unsigned int a2, unsigned int a3, unsigned __int8 *a4, int a5, int a6, int a7, struct tagRECT *a8, unsigned __int8 a9, char a10); +void __cdecl AMBlit(unsigned __int8 *a1, unsigned int a2, unsigned int a3, unsigned __int8 *a4, unsigned int a5, unsigned int a6, int a7, struct tagRECT *a8, unsigned __int8 a9, char a10); // idb int __stdcall cMediaSample::QueryInterface(cMediaSample *this, const _GUID *id, void **ppI); // idb unsigned int __stdcall cMediaSample::AddRef(cMediaSample *this); // idb unsigned int __stdcall cMediaSample::Release(cMediaSample *this); // idb @@ -50062,7 +50062,7 @@ double __cdecl r3_get_vscale(); void __cdecl r3_unproject(mxs_vector *v, float z, float sx, float sy); // idb double __cdecl r3_fov_2_zoom(float degrees); double __cdecl r3_hsize_2_zoom(float z, float w, float pixw); -void __cdecl r3_set_space(unsigned int s); +void __cdecl r3_set_space(r3e_space s); r3e_space __cdecl r3_get_space(); void __cdecl r3_set_space_vector(mxs_vector *v); // idb _r3s_xform_context *__cdecl r3_get_space_vector(); @@ -50077,12 +50077,12 @@ void __cdecl r3_copy_add_delta(_r3s_point *dst, _r3s_point *src, mxs_vector *del void r3_set_prim(); void __cdecl r3_set_2d_clip(unsigned __int8 context); // idb void __cdecl r3_set_color(int color); // idb -void __cdecl r3_set_point_context(int context); // idb -void __cdecl r3_set_line_context(int context); // idb -void __cdecl r3_set_polygon_context(int context); // idb +void __cdecl r3_set_point_context(unsigned int context); +void __cdecl r3_set_line_context(unsigned int context); +void __cdecl r3_set_polygon_context(unsigned int context); void __cdecl r3_force_texture(grs_bitmap *id); // idb void __cdecl r3_set_texture(grs_bitmap *id); // idb -void __cdecl r3_set_clipmode(int x); // idb +void __cdecl r3_set_clipmode(r3e_clipmode x); r3e_clipmode __cdecl r3_get_clipmode(); void __cdecl r3_set_near_plane(float x); // idb double __cdecl r3_get_near_plane(); @@ -50094,7 +50094,7 @@ void r3_init(); int r3_close(); void __cdecl r3_set_default_world(mxs_trans *w); // idb _r3s_trans *__cdecl r3_get_default_world(); -void __cdecl r3_set_default_space(int s); // idb +void __cdecl r3_set_default_space(r3e_space s); r3e_space __cdecl r3_get_default_space(); void __cdecl r3_set_default_stride(int stride); // idb int __cdecl r3_get_default_stride(); // idb @@ -50273,7 +50273,7 @@ void __cdecl mp_list_add(mps_motion_list *list, mps_stack_node *node); // idb void __cdecl mp_list_remove(mps_motion_list *list, mps_stack_node *node); // idb mps_stack_node *__cdecl mp_list_traverse(mps_motion_list *list, mps_stack_node *node); // idb int __cdecl mp_list_clone(mps_motion_list *dst, mps_motion_list *src); // idb -bool __cdecl mp_init(int max_motions); +unsigned __int8 __cdecl mp_init(int max_motions); // idb void mp_close(); void __cdecl mp_init_multiped(multiped *mp); // idb void __cdecl mp_free_multiped(multiped *mp); // idb @@ -50416,7 +50416,7 @@ void __cdecl md_mesh_render_only(mds_model *m, mds_parm *pm); // idb void __cdecl mesh_render_subobj(int i); // idb void __cdecl mesh_render_node(unsigned __int8 *n, unsigned __int16 i); // idb int __cdecl md_rg_indexed_tmap(int n, __int16 *vi, grs_bitmap *bm); // idb -void __cdecl md_render_meshpgon_render_callback(__int16 *trilist, grs_bitmap *bm, int color, char type); +void __cdecl md_render_meshpgon_render_callback(__int16 *trilist, grs_bitmap *bm, unsigned int color, char type); void __cdecl md_mesh_rg_render_pgon(mds_mesh *meshes, SubOMeshList *sml, int SubObjNum, float *norms, unsigned __int16 *indexpnts); // idb void __cdecl md_light_set_type(unsigned __int8 type); // idb void md_light_recompute(); @@ -50510,16 +50510,16 @@ void __thiscall cGenericLoopClient::cRefCount::cRefCount(cGenericLoopClient::cRe tHashSetKey__ *__thiscall cLoopClientDescTable::GetKey(cLoopClientDescTable *this, tHashSetNode__ *node); // idb void __thiscall cLoopClientFactory::cLoopClientFactory(cLoopClientFactory *this); // idb const _GUID **__stdcall cLoopClientFactory::QuerySupport(cLoopClientFactory *this); // idb -BOOL __stdcall cLoopClientFactory::DoesSupport(cLoopClientFactory *this, _GUID *pID); -int __stdcall cLoopClientFactory::GetClient(cLoopClientFactory *this, _GUID *pID, tLoopClientData__ *data, ILoopClient **ppResult); +BOOL __stdcall cLoopClientFactory::DoesSupport(cLoopClientFactory *this, const _GUID *pID); +int __stdcall cLoopClientFactory::GetClient(cLoopClientFactory *this, const _GUID *pID, tLoopClientData__ *data, ILoopClient **ppResult); // idb int __thiscall cLoopClientFactory::AddInnerFactory(cLoopClientFactory *this, ILoopClientFactory *pFactory); // idb int __thiscall cLoopClientFactory::RemoveInnerFactory(cLoopClientFactory *this, ILoopClientFactory *pFactory); // idb void __thiscall cLoopClientFactory::ReleaseAll(cLoopClientFactory *this); // idb -int __thiscall cLoopClientFactory::AddClient(cLoopClientFactory *this, sLoopClientDesc *pClientDesc); -int __thiscall cLoopClientFactory::AddClients(cLoopClientFactory *this, sLoopClientDesc **ppClientDescs); -int __thiscall cLoopClientFactory::RemoveClient(cLoopClientFactory *this, _GUID *pID); +int __thiscall cLoopClientFactory::AddClient(cLoopClientFactory *this, const sLoopClientDesc *pClientDesc); // idb +int __thiscall cLoopClientFactory::AddClients(cLoopClientFactory *this, const sLoopClientDesc **ppClientDescs); // idb +int __thiscall cLoopClientFactory::RemoveClient(cLoopClientFactory *this, const _GUID *pID); // idb __int16 __stdcall cLoopClientFactory::GetVersion(cLoopClientFactory *this); // idb -cLoopClientFactory *__stdcall CreateLoopFactory(sLoopClientDesc **descs); +cLoopClientFactory *__stdcall CreateLoopFactory(const sLoopClientDesc **descs); cLoopClientFactory *__thiscall cLoopClientFactory::`scalar deleting destructor'(cLoopClientFactory *this, char __flags); // void __thiscall cCTUnaggregated::cCTUnaggregated(cCTUnaggregated *this); idb // void __thiscall cLoopClientDescTable::cLoopClientDescTable(cLoopClientDescTable *this); idb @@ -50547,13 +50547,13 @@ void __thiscall cDynArray<_GUID const *>::cDynArray<_GUID const *>(cDynArray<_GU cHashSet *__thiscall cHashSet::`scalar deleting destructor'(cHashSet *this, char __flags); void __thiscall cDynArray_::cDynArray_(cDynArray_ *this); // idb void __thiscall cDynArray_<_GUID const *,4>::cDynArray_<_GUID const *,4>(cDynArray_<_GUID const *,4> *this); // idb -tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, sLoopClientDesc *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, _GUID *key); -tHashSetNode__ *__thiscall cHashSet::RemoveByKey(cHashSet *this, _GUID *k); +tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, const sLoopClientDesc *node); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const _GUID *key); +tHashSetNode__ *__thiscall cHashSet::RemoveByKey(cHashSet *this, const _GUID *k); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb tHashSetNode__ *__thiscall cHashSet::GetFirst(cHashSet *this, tHashSetHandle *Handle); tHashSetNode__ *__thiscall cHashSet::GetNext(cHashSet *this, tHashSetHandle *Handle); -int __thiscall cHashSet::IsEqual(cHashSet *this, _GUID *k1, _GUID *k2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb void __thiscall cDABase>::cDABase>(cDABase > *this); // idb void __thiscall cDABase>::~cDABase>(cDABase > *this); // idb @@ -50590,13 +50590,13 @@ unsigned int __stdcall cLoopManager::cComplexAggregateControl::Release(cLoopMana void __thiscall cLoopManager::cLoopManager(cLoopManager *this, IUnknown *pOuterUnknown, sHashSetChunk **nMaxModes); void __thiscall cLoopManager::~cLoopManager(cLoopManager *this); // idb int __stdcall cLoopManager::AddClient(cLoopManager *this, ILoopClient *pClient, unsigned int *pCookie); // idb -int __stdcall cLoopManager::RemoveClient(cLoopManager *this, _GUID *cookie); +int __stdcall cLoopManager::RemoveClient(cLoopManager *this, const _GUID *cookie); int __stdcall cLoopManager::AddClientFactory(cLoopManager *this, ILoopClientFactory *pFactory, unsigned int *pCookie); // idb int __stdcall cLoopManager::RemoveClientFactory(cLoopManager *this, ILoopClientFactory *cookie); int __stdcall cLoopManager::GetClient(cLoopManager *this, const _GUID *pID, tLoopClientData__ *data, ILoopClient **ppReturn); // idb int __stdcall cLoopManager::AddMode(cLoopManager *this, const sLoopModeDesc *pDesc); // idb -ILoopMode *__stdcall cLoopManager::GetMode(cLoopManager *this, _GUID *pID); -int __stdcall cLoopManager::RemoveMode(cLoopManager *this, _GUID *pID); +ILoopMode *__stdcall cLoopManager::GetMode(cLoopManager *this, const _GUID *pID); // idb +int __stdcall cLoopManager::RemoveMode(cLoopManager *this, const _GUID *pID); // idb int __stdcall cLoopManager::SetBaseMode(cLoopManager *this, ILoopDispatch *pID); ILoopMode *__stdcall cLoopManager::GetBaseMode(cLoopManager *this); // idb int __thiscall cLoopManager::End(cLoopManager *this); // idb @@ -50692,7 +50692,7 @@ void __stdcall cLoopDispatch::DumpTimerInfo(cLoopDispatch *this); // idb int __cdecl TimerSortFunc(cAverageTimer **pLeft, cAverageTimer **pRight); int __stdcall cLoopDispatch::SendMessage(cLoopDispatch *this, int message, tLoopMessageData__ *hData, char flags); int __cdecl MessageToIndex(unsigned int message); // idb -void __cdecl LoopTrack(int message, const char *pszClient); +void __cdecl LoopTrack(unsigned int message, const char *pszClient); // idb unsigned __int8 LoopTrackClear(); int __stdcall cLoopDispatch::SendSimpleMessage(cLoopDispatch *this, int message); // idb int __stdcall cLoopDispatch::PostMessage(cLoopDispatch *this, int message, tLoopMessageData__ *hData, int flags); // idb @@ -50774,7 +50774,7 @@ void __thiscall cDABase>::~cDABase>::operator[](cDABase > *this, unsigned int index); unsigned int __thiscall cDABase>::Append(cDABase > *this, sClientInfo *const *item); // idb // unsigned int __thiscall cDABase>::Size(cDABase > *this); idb -sPriGuidSetEntry **__thiscall cPriGuidSet>::operator[](cPriGuidSet > *this, int i); +sPriGuidSetEntry **__thiscall cPriGuidSet>::operator[](cPriGuidSet > *this, unsigned int i); unsigned int __thiscall cPriGuidSet>::Append(cPriGuidSet > *this, sPriIntInfo *pToAdd); // idb void __thiscall cPriIntArray::cPriIntArray(cPriIntArray *this); // idb void __thiscall cDABase>::cDABase>(cDABase > *this); // idb @@ -50841,9 +50841,9 @@ void lgd3d_zclear(); void __cdecl lgd3d_set_znearfar(long double znear, long double zfar); // idb void __cdecl setwbnf(IDirect3DDevice3 *lpDev, long double dvWNear, long double dvWFar); // idb void __cdecl lgd3d_get_znearfar(long double *pdZNear, long double *pdZFar); // idb -void __cdecl lgd3d_set_pal(int start, int n, unsigned __int8 *pal_data); -void __cdecl lgd3d_set_pal_slot(int start, int n, unsigned __int8 *pal_data, int slot); -void __cdecl lgd3d_set_pal_slot_flags(int start, int n, unsigned __int8 *pal_data, int slot, char flags); +void __cdecl lgd3d_set_pal(unsigned int start, unsigned int n, unsigned __int8 *pal_data); // idb +void __cdecl lgd3d_set_pal_slot(unsigned int start, unsigned int n, unsigned __int8 *pal_data, int slot); // idb +void __cdecl lgd3d_set_pal_slot_flags(unsigned int start, unsigned int n, unsigned __int8 *pal_data, int slot, char flags); void __cdecl lgd3d_get_trans_texture_bitmask(grs_rgb_bitmask *bitmask); // idb void __cdecl lgd3d_get_opaque_texture_bitmask(grs_rgb_bitmask *bitmask); // idb void __cdecl lgd3d_get_alpha_texture_bitmask(grs_rgb_bitmask *bitmask); // idb @@ -50939,7 +50939,7 @@ int __cdecl tmgr_get_utilization(float *utilization); // idb void __cdecl tmgr_restore_bits(grs_bitmap *bm); // idb void __cdecl swapout_bitmap(tdrv_texture_info *info, tmap_chain *chain); // idb void __cdecl do_unload(grs_bitmap *bm); // idb -void __cdecl release_texture(int i); // idb +void __cdecl release_texture(unsigned int i); int dump_all_textures(); void __cdecl tmgr_unload_texture(grs_bitmap *bm); // idb void __cdecl tmgr_reload_texture(grs_bitmap *bm); // idb @@ -50980,7 +50980,7 @@ int __thiscall cD6States::get_texture_id(cD6States *this); // idb void __thiscall cD6States::TurnOffTexuring(cD6States *this, int bTexOff); // idb void __thiscall cD6States::SetDithering(cD6States *this, int bOn); // idb void __thiscall cD6States::SetAntialiasing(cD6States *this, int bOn); // idb -void __thiscall cD6States::EnableDepthBuffer(cD6States *this, int nFlag); // idb +void __thiscall cD6States::EnableDepthBuffer(cD6States *this, _D3DZBUFFERTYPE nFlag); void __thiscall cD6States::SetZWrite(cD6States *this, int bZWriteOn); // idb void __thiscall cD6States::SetZCompare(cD6States *this, int bZCompreOn); // idb void __thiscall cD6States::SetFogDensity(cD6States *this, float fDensity); // idb @@ -51002,8 +51002,8 @@ int __thiscall cD6States::get_color(cD6States *this); void __thiscall cD6States::SetTextureNow(cD6States *this); // idb void __thiscall cD6States::set_texture_id(cD6States *this, int n); // idb void __thiscall cD6States::EnablePalette(cD6States *this, int bPalOn); // idb -void __thiscall cD6States::SetPalSlotFlags(cD6States *this, int start, int n, unsigned __int8 *pal_data, int slot, char flags); -void __thiscall cD6States::SetTexturePalette(cD6States *this, int start, int n, unsigned __int8 *pal, int slot); // idb +void __thiscall cD6States::SetPalSlotFlags(cD6States *this, unsigned int start, unsigned int n, unsigned __int8 *pal_data, int slot, char flags); +void __thiscall cD6States::SetTexturePalette(cD6States *this, unsigned int start, int n, unsigned __int8 *pal, int slot); void __thiscall cD6States::SetAlphaPalette(cD6States *this, unsigned __int16 *pal); // idb void __thiscall cD6States::SetChromaKey(cD6States *this, int r, int g, int b); // idb int __thiscall cD6States::SetTexWrapping(cD6States *this, unsigned int dwLevel, int bSetSmooth); // idb @@ -51052,7 +51052,7 @@ void __thiscall cD6States::SetLightMapMode(cD6States *this, unsigned int dwFlag) void __thiscall cD6States::SetTextureLevel(cD6States *this, int n); // idb cImStates *__thiscall cImStates::`scalar deleting destructor'(cImStates *this, char __flags); cMSStates *__thiscall cMSStates::`scalar deleting destructor'(cMSStates *this, char __flags); -void __thiscall cMSStates::SetTextureLevel(cMSStates *this, int n); // idb +void __thiscall cMSStates::SetTextureLevel(cMSStates *this, unsigned int n); void __cdecl lgd3d_set_zlinear(int lin); // idb void __thiscall cD6Frame::cD6Frame(cD6Frame *this, unsigned int dwWidth, unsigned int dwHeight, lgd3ds_device_info *psDeviceInfo); // idb void __thiscall cD6Frame::cD6Frame(cD6Frame *this, ILGSurface *pILGSurface); // idb @@ -51175,7 +51175,7 @@ int __stdcall cLGSurface::CreateInternalScreenSurface(cLGSurface *this, HWND__ * int __stdcall cLGSurface::ChangeClipper(cLGSurface *this, HWND__ *hMainWindow); // idb int __stdcall cLGSurface::SetAs3dHdwTarget(cLGSurface *this, unsigned int dwRequestedFlags, unsigned int dwWidth, unsigned int dwHeight, unsigned int dwBitDepth, unsigned int *pdwCapabilityFlags, grs_canvas **ppsCanvas); // idb int __stdcall cLGSurface::Resize3dHdw(cLGSurface *this, unsigned int dwRequestedFlags, unsigned int dwWidth, unsigned int dwHeight, unsigned int dwBitDepth, unsigned int *pdwCapabilityFlags, grs_canvas **ppsCanvas); // idb -int __stdcall cLGSurface::BlitToScreen(cLGSurface *this, int dwXScreen, int dwYScreen, unsigned int dwWidth, unsigned int dwHeight); +int __stdcall cLGSurface::BlitToScreen(cLGSurface *this, unsigned int dwXScreen, unsigned int dwYScreen, unsigned int dwWidth, unsigned int dwHeight); // idb void __stdcall cLGSurface::CleanSurface(cLGSurface *this); // idb void __stdcall cLGSurface::Start3D(cLGSurface *this); // idb void __stdcall cLGSurface::End3D(cLGSurface *this); // idb @@ -51337,8 +51337,8 @@ void __thiscall cScriptMan::LoadClasses(cScriptMan *this); // idb int __stdcall cScriptMan::AddModule(cScriptMan *this, const char *pszModule); // idb int __stdcall cScriptMan::RemoveModule(cScriptMan *this, const char *pszModule); // idb int __stdcall cScriptMan::ClearModules(cScriptMan *this); // idb -int __stdcall cScriptMan::ExposeService(cScriptMan *this, IUnknown *pService, _GUID *pGuid); -IUnknown *__stdcall cScriptMan::GetService(cScriptMan *this, _GUID *pGuid); +int __stdcall cScriptMan::ExposeService(cScriptMan *this, IUnknown *pService, const _GUID *pGuid); // idb +IUnknown *__stdcall cScriptMan::GetService(cScriptMan *this, const _GUID *pGuid); // idb tHashSetNode__ *__stdcall cScriptMan::GetFirstClass(cScriptMan *this, tScrIter__ **pIter); tHashSetNode__ *__stdcall cScriptMan::GetNextClass(cScriptMan *this, tScrIter__ **pIter); void __stdcall cScriptMan::EndClassIter(cScriptMan *this, tScrIter__ **pIter); // idb @@ -51359,11 +51359,11 @@ tScrTimer__ *__stdcall cScriptMan::SetTimedMessage(cScriptMan *this, sScrMsg *pM tScrTimer__ *__stdcall cScriptMan::SetTimedMessage2(cScriptMan *this, int to, const char *pszMessage, unsigned int time, eScrTimedMsgKind kind, const cMultiParm *data); // idb void __stdcall cScriptMan::KillTimedMessage(cScriptMan *this, tScrTimer__ *timer); // idb int __stdcall cScriptMan::PumpMessages(cScriptMan *this); // idb -BOOL __stdcall cScriptMan::IsScriptDataSet(cScriptMan *this, sScrDatumTag *pTag); -int __stdcall cScriptMan::GetScriptData(cScriptMan *this, sScrDatumTag *pTag, sMultiParm *pParm); -int __stdcall cScriptMan::SetScriptData(cScriptMan *this, sScrDatumTag *pTag, const sMultiParm *pParm); -int __stdcall cScriptMan::ClearScriptData(cScriptMan *this, sScrDatumTag *pTag, sMultiParm *pParm); -int __stdcall cScriptMan::AddTrace(cScriptMan *this, int Object, char *pszMessage, eScrTraceAction ScrTraceAction, int iTraceLine); // idb +BOOL __stdcall cScriptMan::IsScriptDataSet(cScriptMan *this, const sScrDatumTag *pTag); +int __stdcall cScriptMan::GetScriptData(cScriptMan *this, const sScrDatumTag *pTag, sMultiParm *pParm); // idb +int __stdcall cScriptMan::SetScriptData(cScriptMan *this, const sScrDatumTag *pTag, const sMultiParm *pParm); // idb +int __stdcall cScriptMan::ClearScriptData(cScriptMan *this, const sScrDatumTag *pTag, sMultiParm *pParm); // idb +int __stdcall cScriptMan::AddTrace(cScriptMan *this, int Object, char *pszMessage, eScrTraceAction ScrTraceAction, unsigned int iTraceLine); int __stdcall cScriptMan::RemoveTrace(cScriptMan *this, int Object, char *pszMessage); // idb BOOL __stdcall cScriptMan::GetTraceLine(cScriptMan *this, char iTraceLine); void __stdcall cScriptMan::SetTraceLine(cScriptMan *this, char iTraceLine, int bStatus); @@ -51421,7 +51421,7 @@ void __thiscall cDynArray_::~cDynArray_(cDyn void __thiscall cDynArray_::~cDynArray_(cDynArray_ *this); // idb void __thiscall cDynArray_::~cDynArray_(cDynArray_ *this); // idb void __thiscall cDynArray_::~cDynArray_(cDynArray_ *this); // idb -void __thiscall cScrClassDescTable::Insert(cScrClassDescTable *this, sScrClassDesc *p); +void __thiscall cScrClassDescTable::Insert(cScrClassDescTable *this, const sScrClassDesc *p); // idb tHashSetNode__ *__thiscall cScrClassDescTable::Search(cScrClassDescTable *this, char *p); void __thiscall cScrScriptInfo::cScrScriptInfo(cScrScriptInfo *this, const char *pszClassName); // idb void __thiscall cDListNode::cDListNode(cDListNode *this); // idb @@ -51518,12 +51518,12 @@ tHashSetNode__ *__thiscall cHashSet::GetNext(cHash int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, sScrDatum *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, sScrDatumTag *key); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const sScrDatumTag *key); tHashSetNode__ *__thiscall cHashSet::Remove(cHashSet *this, sScrDatum *node); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb tHashSetNode__ *__thiscall cHashSet::GetFirst(cHashSet *this, tHashSetHandle *Handle); tHashSetNode__ *__thiscall cHashSet::GetNext(cHashSet *this, tHashSetHandle *Handle); -BOOL __thiscall cHashSet::IsEqual(cHashSet *this, sScrDatumTag *k1, sScrDatumTag *k2); +BOOL __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); BOOL __cdecl cScriptsDataHash::IsEqual(const sScrDatumTag *p1, const sScrDatumTag *p2); int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); int __cdecl cScriptsDataHash::Hash(const sScrDatumTag *p); @@ -51545,16 +51545,16 @@ tHashSetNode__ *__thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, sServiceTableEntry *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, _GUID *key); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const _GUID *key); tHashSetNode__ *__thiscall cHashSet::Remove(cHashSet *this, sServiceTableEntry *node); -tHashSetNode__ *__thiscall cHashSet::RemoveByKey(cHashSet *this, _GUID *k); +tHashSetNode__ *__thiscall cHashSet::RemoveByKey(cHashSet *this, const _GUID *k); tHashSetNode__ *__thiscall cHashSet::RemoveByHandle(cHashSet *this, const tHashSetHandle *h); tHashSetHandle *__thiscall cHashSet::GetHandle(cHashSet *this, tHashSetHandle *result, sServiceTableEntry *__$ReturnUdt); // idb void __thiscall cHashSet::Rehash(cHashSet *this, tHashSetHandle Handle, sServiceTableEntry *node); // idb void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb tHashSetNode__ *__thiscall cHashSet::GetFirst(cHashSet *this, tHashSetHandle *Handle); tHashSetNode__ *__thiscall cHashSet::GetNext(cHashSet *this, tHashSetHandle *Handle); -int __thiscall cHashSet::IsEqual(cHashSet *this, _GUID *k1, _GUID *k2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb unsigned int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); // idb void __thiscall cDABase>::Shrink(cDABase > *this, unsigned int num); // idb void __thiscall cDABase>::cDABase>(cDABase > *this); // idb @@ -51662,7 +51662,7 @@ void __thiscall sScrDatum::sScrDatum(sScrDatum *this); // idb BOOL __thiscall cScrObjFilter::Match(cScrObjFilter *this, cScrObj *pObj); sScrObjFilterTag *__thiscall cDABase>::operator[](cDABase > *this, unsigned int index); // unsigned int __thiscall cDABase>::Size(cDABase > *this); idb -int __thiscall cScriptMan::LoadModule(cScriptMan *this, cFileSpec *fsModule, sScrModuleInfo *pInfo); +int __thiscall cScriptMan::LoadModule(cScriptMan *this, cFileSpec *fsModule, sScrModuleInfo *pInfo); // idb void __thiscall cScriptMan::FreeModule(cScriptMan *this, sScrModuleInfo *pInfo); // idb int _E11_59(); void _E8_64(); @@ -51763,7 +51763,7 @@ cMemorySegment *__thiscall cMemorySegment::`scalar deleting destructor'(cMemoryS void __thiscall cFileSegment::cFileSegment(cFileSegment *this); // idb void __thiscall cFileSegment::~cFileSegment(cFileSegment *this); // idb void __thiscall cFileSegment::Init(cFileSegment *this, char *pName, unsigned int offset, _sSndAttribs *pAttribs, int doDouble); // idb -void *__thiscall cFileSegment::GetRawData(cFileSegment *this, void *pDst, unsigned int nBytes); // idb +void *__thiscall cFileSegment::GetRawData(cFileSegment *this, void *pDst, size_t nBytes); cFileSegment *__thiscall cFileSegment::`scalar deleting destructor'(cFileSegment *this, char __flags); // void __thiscall cRezSegment::cRezSegment(cRezSegment *this); idb // void __thiscall cRezSegment::~cRezSegment(cRezSegment *this); idb @@ -51783,13 +51783,13 @@ int __cdecl ObjRefSystemInit(int max_objs, int max_refs, int num_systems, void ( int __cdecl ObjRefSystemTerm(); // idb int __cdecl ObjRefSystemRegister(char bin_size, unsigned int *(__cdecl *ref_list_func)(void *, int), void (__cdecl *ref_list_clear_func)(void *), int (__cdecl *bin_compare_func)(void *, void *), void (__cdecl *bin_update_func)(int, int, void *, int), void (__cdecl *bin_print_func)(void *, char *, int), int (__cdecl *bin_compute_func)(int, BoundingPrism *, void *)); ObjRefInfo *ObjsInitRefs(); -unsigned int __cdecl ObjRefGrab(int system); +unsigned int __cdecl ObjRefGrab(unsigned int system); // idb void __cdecl ObjRefReturnToStorage(unsigned int ref); // idb int __cdecl ObjLinkMake(int obj, unsigned int ref); // idb int __cdecl ObjLinkDel(unsigned int ref); // idb int __cdecl ObjRefAdd(unsigned int ref, void *bin); // idb void __cdecl ObjRefRem(unsigned int ref); // idb -unsigned int __cdecl ObjRefMake(int obj, int refsys, void *bin); +unsigned int __cdecl ObjRefMake(int obj, unsigned int refsys, void *bin); // idb int __cdecl ObjRefDel(unsigned int ref); // idb int __cdecl ObjDelRefsOfSystem(int obj, unsigned int refsys); // idb int __cdecl ObjDelRefs(int obj); // idb @@ -51816,9 +51816,9 @@ int __stdcall cSdescTools::ParseSimple(cSdescTools *this, const sStructDesc *des int __stdcall cSdescTools::UnparseSimple(cSdescTools *this, const sStructDesc *desc, char *struc, char *out, int len); int __stdcall cSdescTools::Dump(cSdescTools *this, const sStructDesc *sdesc, char *struc); int __stdcall cSdescTools::ParseFull(cSdescTools *this, const sStructDesc *sdesc, char *string, char *struc); -int __stdcall cSdescTools::UnparseFull(cSdescTools *this, const sStructDesc *sdesc, char *struc, char *out, int buflen); +int __stdcall cSdescTools::UnparseFull(cSdescTools *this, const sStructDesc *sdesc, char *struc, char *out, size_t buflen); const sStructDesc *__stdcall cSdescTools::Lookup(cSdescTools *this, const char *name); // idb -int __stdcall cSdescTools::Register(cSdescTools *this, sStructDesc *desc); +int __stdcall cSdescTools::Register(cSdescTools *this, const sStructDesc *desc); // idb int __stdcall cSdescTools::ClearRegistry(cSdescTools *this); // idb void SdescToolsCreate(); // IUnknown *__thiscall cSdescTools::cOuterPointer::operator->(cSdescTools::cOuterPointer *this); idb @@ -51856,7 +51856,7 @@ int __thiscall cHashTable::find __int16 __thiscall cHashTable::Grow(cHashTable *this, int newsize); // idb const sFieldDesc *__cdecl StructDescFindField(const sStructDesc *desc, const char *name); // idb int __cdecl sd_cast_to_long(int *val, unsigned int size, int is_signed); -void __cdecl sd_stuff_from_long(int *val, int in, unsigned int size); // idb +void __cdecl sd_stuff_from_long(int *val, int in, size_t size); void __cdecl parse_int(const sFieldDesc *desc, int *val, char *in); void __cdecl unparse_int(const sFieldDesc *desc, int *val, char *out); void __cdecl parse_bool(const sFieldDesc *desc, int *val, char *in); @@ -51901,7 +51901,7 @@ void __cdecl StructDumpStruct(char *struc, const sStructDesc *desc); BOOL __cdecl StructDescIsSimple(const sStructDesc *desc); int __cdecl StructToSimpleString(char *struc, const sStructDesc *desc, char *out); int __cdecl StructFromSimpleString(char *struc, const sStructDesc *desc, char *in); -int __cdecl StructToFullString(char *struc, const sStructDesc *desc, char *out, int len); +int __cdecl StructToFullString(char *struc, const sStructDesc *desc, char *out, size_t len); int __cdecl StructFromFullString(char *struc, const sStructDesc *desc, char *in); int __stdcall _AsyncReadQueueCreate(const _GUID *__formal, IAsyncReadQueue **a2, IUnknown *pOuterUnknown); // idb int __stdcall cARQManager::QueryInterface(cARQManager *this, const _GUID *id, void **ppI); // idb @@ -52088,8 +52088,8 @@ void __stdcall cInputBinder::SetValidEvents(cInputBinder *this, unsigned int eve unsigned int __stdcall cInputBinder::GetValidEvents(cInputBinder *this); // idb BOOL __stdcall cInputBinder::Bind(cInputBinder *this, char *pControl, char *pCmd); BOOL __stdcall cInputBinder::Unbind(cInputBinder *this, char *pControl); -void __stdcall cInputBinder::QueryBind(cInputBinder *this, char *pControl, char *pCmdBuf, int iBufLen); // idb -void __stdcall cInputBinder::GetVarValue(cInputBinder *this, char *pVarStr, char *pValBuf, int iBufLen); // idb +void __stdcall cInputBinder::QueryBind(cInputBinder *this, char *pControl, char *pCmdBuf, size_t iBufLen); +void __stdcall cInputBinder::GetVarValue(cInputBinder *this, char *pVarStr, char *pValBuf, size_t iBufLen); char *__stdcall cInputBinder::ProcessCmd(cInputBinder *this, char *p_cmd); // idb void __stdcall cInputBinder::TrapBind(cInputBinder *this, char *p_cmd, int (__cdecl *filter_cb)(char *, char *, void *), void (__cdecl *post_cb)(int), void *data); // idb char *__stdcall cInputBinder::Update(cInputBinder *this); // idb @@ -52323,16 +52323,16 @@ void __stdcall cResMan::UnlockResource(cResMan *this, IRes *pResource); // idb int __stdcall cResMan::GetResourceLockCount(cResMan *this, IRes *pResource); int __thiscall cResMan::DropResourceData(cResMan *this, cResourceTypeData *pData); // idb int __stdcall cResMan::DropResource(cResMan *this, IRes *pResource); // idb -int __stdcall cResMan::GetResourceSize(cResMan *this, IRes *pRes); // idb +unsigned int __stdcall cResMan::GetResourceSize(cResMan *this, IRes *pRes); int __stdcall cResMan::AsyncLock(cResMan *this, IRes *pResource, int nPriority); // idb int __stdcall cResMan::AsyncExtract(cResMan *this, IRes *pResource, int nPriority, void *pBuf, int bufSize); // idb int __stdcall cResMan::AsyncPreload(cResMan *this, IRes *pResource); // idb int __stdcall cResMan::IsAsyncFulfilled(cResMan *this, IRes *pResource); // idb int __stdcall cResMan::AsyncKill(cResMan *this, IRes *pResource); // idb int __stdcall cResMan::GetAsyncResult(cResMan *this, IRes *pResource, void **ppResult); // idb -void __stdcall cResMan::EnablePaging(cResMan *this, int bEnable); // idb +void __stdcall cResMan::EnablePaging(cResMan *this, unsigned int bEnable); void __stdcall cResMan::Compact(cResMan *this); // idb -void __stdcall cResMan::SetMode(cResMan *this, eResStatMode mode, int bTurnOn); +void __stdcall cResMan::SetMode(cResMan *this, eResStatMode mode, int bTurnOn); // idb void __stdcall cResMan::Dump(cResMan *this, const char *pFile); // idb void __stdcall cResMan::DumpSnapshot(cResMan *this, const char *pFile); // idb void __thiscall cResMan::DoDumpSnapshot(cResMan *this, _iobuf *fp); // idb @@ -52683,7 +52683,7 @@ void __thiscall cNamedStatsHash::~cNamedStatsHash(cNamedStatsHash *this); // idb tHashSetKey__ *__thiscall cNamedStatsHash::GetKey(cNamedStatsHash *this, tHashSetNode__ *node); // idb void __thiscall cResStats::cResStats(cResStats *this); // idb void __thiscall cResStats::~cResStats(cResStats *this); // idb -void __thiscall cResStats::SetMode(cResStats *this, eResStatMode ResStatMode, int bTurnOn); +void __thiscall cResStats::SetMode(cResStats *this, eResStatMode ResStatMode, int bTurnOn); // idb void __thiscall cResStats::DumpItem(cResStats *this, _iobuf *fp, unsigned int *m_Stats); // idb void __thiscall cResStats::DumpTable(cResStats *this, _iobuf *fp, cNamedStatsHash *pTable); // idb void __thiscall cResStats::Dump(cResStats *this, const char *pFile); // idb @@ -52873,7 +52873,7 @@ BOOL __stdcall cResourceBase::Drop(cResourceBase::GetSize(cResourceBase *this); // idb int __stdcall cResourceBase::Extract(cResourceBase *this, void *pBuf); void *__stdcall cResourceBase::PreLoad(cResourceBase *this); // idb -int __stdcall cResourceBase::ExtractPartial(cResourceBase *this, int nStart, int nEnd, void *pBuf); +size_t __stdcall cResourceBase::ExtractPartial(cResourceBase *this, int nStart, int nEnd, void *pBuf); void __stdcall cResourceBase::ExtractBlocks(cResourceBase *this, void *pBuf, int nSize, int (__cdecl *Callback)(IRes *, void *, int, int, void *), void *pCallbackData); int __stdcall cResourceBase::AsyncLock(cResourceBase *this, int nPriority); int __stdcall cResourceBase::AsyncExtract(cResourceBase *this, int nPriority, void *pBuf, int bufSize); @@ -52888,7 +52888,7 @@ int __stdcall cResourceBase::HasSetData(cResourceBas int __stdcall cResourceBase::SetStore(cResourceBase *this, IStore *pNewStorage); // idb IStore *__stdcall cResourceBase::GetStore(cResourceBase *this); // idb void __stdcall cResourceBase::SetName(cResourceBase *this, const char *pNewName); // idb -void __stdcall cResourceBase::AllowStorageReset(cResourceBase *this, int bAllow); // idb +void __stdcall cResourceBase::AllowStorageReset(cResourceBase *this, unsigned int bAllow); void __stdcall cResourceBase::SetCanonStore(cResourceBase *this, IStore *pCanonStore); // idb void *__stdcall cResourceBase::LoadData(cResourceBase *this, unsigned int *pSize, unsigned int *pTimestamp, IResMemOverride *pResMem); // idb int __stdcall cResourceBase::FreeData(cResourceBase *this, void *pData, unsigned int __formal, IResMemOverride *pResMem); // idb @@ -52953,7 +52953,7 @@ BOOL __stdcall cResourceBase::Drop(cReso int __stdcall cResourceBase::GetSize(cResourceBase *this); // idb int __stdcall cResourceBase::Extract(cResourceBase *this, void *pBuf); void *__stdcall cResourceBase::PreLoad(cResourceBase *this); // idb -int __stdcall cResourceBase::ExtractPartial(cResourceBase *this, int nStart, int nEnd, void *pBuf); +size_t __stdcall cResourceBase::ExtractPartial(cResourceBase *this, int nStart, int nEnd, void *pBuf); void __stdcall cResourceBase::ExtractBlocks(cResourceBase *this, void *pBuf, int nSize, int (__cdecl *Callback)(IRes *, void *, int, int, void *), void *pCallbackData); int __stdcall cResourceBase::AsyncLock(cResourceBase *this, int nPriority); int __stdcall cResourceBase::AsyncExtract(cResourceBase *this, int nPriority, void *pBuf, int bufSize); @@ -52968,7 +52968,7 @@ int __stdcall cResourceBase::HasSetData( int __stdcall cResourceBase::SetStore(cResourceBase *this, IStore *pNewStorage); // idb IStore *__stdcall cResourceBase::GetStore(cResourceBase *this); // idb void __stdcall cResourceBase::SetName(cResourceBase *this, const char *pNewName); // idb -void __stdcall cResourceBase::AllowStorageReset(cResourceBase *this, int bAllow); // idb +void __stdcall cResourceBase::AllowStorageReset(cResourceBase *this, unsigned int bAllow); void __stdcall cResourceBase::SetCanonStore(cResourceBase *this, IStore *pCanonStore); // idb void *__stdcall cResourceBase::LoadData(cResourceBase *this, unsigned int *pSize, unsigned int *pTimestamp, IResMemOverride *pResMem); // idb int __stdcall cResourceBase::FreeData(cResourceBase *this, void *pData, unsigned int __formal, IResMemOverride *pResMem); // idb @@ -52990,13 +52990,13 @@ cStringResEntry *__thiscall cStringResEntry::`scalar deleting destructor'(cStrin void __thiscall cImageResource::cImageResource(cImageResource *this, IStore *pStore, const char *pName, IResType *pType, eImgKind Kind); // idb grs_bitmap *__stdcall cImageResource::LoadData(cImageResource *this, unsigned int *pSize, unsigned int *pTimestamp, IResMemOverride *pResMem); int __stdcall cImageResource::FreeData(cImageResource *this, grs_bitmap *pData, unsigned int __formal, IResMemOverride *pResMem); -int __stdcall cImageResource::ExtractPartial(cImageResource *this, int nStart, int nEnd, void *pBuf); +size_t __stdcall cImageResource::ExtractPartial(cImageResource *this, int nStart, int nEnd, void *pBuf); void __stdcall cImageResource::ExtractBlocks(cImageResource *this, void *pBuf, int nSize, int (__cdecl *Callback)(IRes *, void *, int, int, void *), void *pClientData); cImageResource *__thiscall cImageResource::`scalar deleting destructor'(cImageResource *this, char __flags); void __thiscall cImageResource::~cImageResource(cImageResource *this); // idb void __thiscall cPaletteResource::cPaletteResource(cPaletteResource *this, IStore *pStore, const char *pName, IResType *pType, ePalKind Kind); // idb void *__stdcall cPaletteResource::LoadData(cPaletteResource *this, unsigned int *pSize, unsigned int *pTimestamp, IResMemOverride *pResMem); // idb -int __stdcall cPaletteResource::ExtractPartial(cPaletteResource *this, int nStart, int nEnd, void *pBuf); +size_t __stdcall cPaletteResource::ExtractPartial(cPaletteResource *this, int nStart, int nEnd, void *pBuf); void __stdcall cPaletteResource::ExtractBlocks(cPaletteResource *this, void *pBuf, int nSize, int (__cdecl *Callback)(IRes *, void *, int, int, void *), void *pClientData); cPaletteResource *__thiscall cPaletteResource::`vector deleting destructor'(cPaletteResource *this, char __flags); void __thiscall cPaletteResource::~cPaletteResource(cPaletteResource *this); // idb @@ -53112,7 +53112,7 @@ grs_bitmap *__cdecl ResTgaReadImage(IStoreStream *pStream, IResMemOverride *pRes void *__cdecl ResTgaReadPalette(IStoreStream *pStream, IResMemOverride *pResMem); // idb unsigned __int8 __cdecl PcxReadHeader(IStoreStream *pStream, PCXHEAD *phead); // idb unsigned __int8 __cdecl PcxReadRow(IStoreStream *pStream, unsigned __int8 *p, __int16 npixels); // idb -unsigned __int8 __cdecl PcxReadBody(IStoreStream *pStream, unsigned __int8 *bits, unsigned __int8 type, __int16 w, __int16 h, unsigned __int16 row, __int16 bpl); +unsigned __int8 __cdecl PcxReadBody(IStoreStream *pStream, unsigned __int8 *bits, unsigned __int8 type, __int16 w, __int16 h, unsigned __int16 row, unsigned __int16 bpl); // idb grs_bitmap *__cdecl ResPcxReadImage(IStoreStream *pStream, IResMemOverride *pResMem); // idb unsigned __int8 *__cdecl ResPcxReadPalette(IStoreStream *pStream, IResMemOverride *pResMem); unsigned __int8 __cdecl ResUnpackImage(IStoreStream *pStream, int bits, unsigned __int8 *buffer, ImageBlock *pImageBlock); // idb @@ -53137,10 +53137,10 @@ int _E8_66(); void __cdecl _E6_58(); // idb size_t __cdecl PkExplodeReader(char *buf, unsigned int *size, _DWORD *param); void __cdecl PkExplodeWriter(char *buf, unsigned int *size, void *param); // idb -int __cdecl PkExplodeStreamToMem(IStoreStream *pSourceStream, char *pDest, int skip, int destMax); +int __cdecl PkExplodeStreamToMem(IStoreStream *pSourceStream, char *pDest, unsigned int skip, int destMax); void *__cdecl ZAllocInterface(void *__formal, unsigned int items, unsigned int size); // idb void __cdecl ZFreeInterface(void *__formal, void *addr); // idb -int __cdecl ZInflateStreamToMem(IStoreStream *pStream, int nStreamSize, unsigned __int8 *pData, int nSize); +int __cdecl ZInflateStreamToMem(IStoreStream *pStream, int nStreamSize, unsigned __int8 *pData, unsigned int nSize); int __stdcall cZipStream::QueryInterface(cZipStream *this, const _GUID *id, void **ppI); // idb unsigned int __stdcall cZipStream::AddRef(cZipStream *this); // idb unsigned int __stdcall cZipStream::Release(cZipStream *this); // idb @@ -53196,7 +53196,7 @@ int __cdecl inflateEnd(z_stream_s *z); // idb int __cdecl inflateInit2_(z_stream_s *z, int w, const char *version, int stream_size); // idb int __cdecl inflateInit_(z_stream_s *z, const char *version, int stream_size); // idb unsigned int __cdecl inflate(z_stream_s *z, int f); -int __cdecl inflateSetDictionary(z_stream_s *z, const unsigned __int8 *dictionary, unsigned int dictLength); // idb +int __cdecl inflateSetDictionary(z_stream_s *z, const unsigned __int8 *dictionary, size_t dictLength); int __cdecl inflateSync(z_stream_s *z); // idb int __cdecl inflateSyncPoint(z_stream_s *z); // idb char *__cdecl zlibVersion(); @@ -53208,7 +53208,7 @@ void __cdecl inflate_blocks_reset(inflate_blocks_state *s, z_stream_s *z, unsign inflate_blocks_state *__cdecl inflate_blocks_new(z_stream_s *z, unsigned int (__cdecl *c)(unsigned int, const unsigned __int8 *, unsigned int), unsigned int w); // idb int __cdecl inflate_blocks(inflate_blocks_state *s, z_stream_s *z, unsigned int r); int __cdecl inflate_blocks_free(inflate_blocks_state *s, z_stream_s *z); // idb -void __cdecl inflate_set_dictionary(inflate_blocks_state *s, const unsigned __int8 *d, unsigned int n); // idb +void __cdecl inflate_set_dictionary(inflate_blocks_state *s, const unsigned __int8 *d, size_t n); BOOL __cdecl inflate_blocks_sync_point(inflate_blocks_state *s); int __cdecl adler32(unsigned int adler, const unsigned __int8 *buf, unsigned int len); inflate_codes_state *__cdecl inflate_codes_new(char bl, char bd, inflate_huft_s *tl, inflate_huft_s *td, z_stream_s *z); @@ -53223,7 +53223,7 @@ int __cdecl inflate_fast(unsigned int bl, unsigned int bd, inflate_huft_s *tl, i int __cdecl CreateServiceProviderAddress(IDirectPlayLobby3 *pIDirectPlayLobby3A, void **ppDPlayAddress, unsigned int *puDPlayAddressSize, char *IPAddress); // idb void NetCreate(); void __thiscall cNet::cNet(cNet *this, IUnknown *pOuter); // idb -int __stdcall cNet::Init(cNet *this); // idb +HRESULT __stdcall cNet::Init(cNet *this); int __stdcall cNet::End(cNet *this); // idb int __stdcall cNet::JoinOrCreate(cNet *this, char *conn, char *sessionName, int *created, void *__formal); // idb int __stdcall cNet::ConnCallback(const _GUID *__formal, void *lpConnection, unsigned int dwSize, const DPNAME *lpName, unsigned int a5, char *lpContext); @@ -53231,7 +53231,7 @@ int __stdcall cNet::SessionCallback(const DPSESSIONDESC2 *lpThisSD, unsigned int int __stdcall cNet::Host(cNet *this, char *conn, char *sessionName); // idb int __stdcall cNet::Join(cNet *this, char *conn, char *sessionName, char *IPAddress); // idb int __stdcall cNet::GetPlayerAddress(cNet *this, unsigned int player, char *pAddress, int addrSize); // idb -int __stdcall cNet::addressCallback(const _GUID *guid, unsigned int dataSize, const void *data, void **context); +int __stdcall cNet::addressCallback(const _GUID *guid, size_t dataSize, const void *data, void **context); unsigned int __stdcall cNet::SimpleCreatePlayer(cNet *this, char *name); // idb unsigned int __stdcall cNet::IdForName(cNet *this, char *name); // idb int __stdcall cNet::PlayerCallback(const char *dpId, unsigned int __formal, const DPNAME *lpName, unsigned int a4, const char **lpContext); @@ -53374,11 +53374,11 @@ unsigned int __stdcall TagFileBase::AddRef(TagFileBase *this); // idb unsigned int __stdcall TagFileBase::Release(TagFileBase *this); // idb void __thiscall TagFileBase::~TagFileBase(TagFileBase *this); // idb const VersionNum *__stdcall TagFileBase::GetVersion(TagFileBase *this); // idb -unsigned int __stdcall TagFileBase::BlockSize(TagFileBase *this, _TagFileTag *tag); +unsigned int __stdcall TagFileBase::BlockSize(TagFileBase *this, const _TagFileTag *tag); // idb TagTableEntry *__stdcall TagFileBase::CurrentBlock(TagFileBase *this); -void __thiscall TagFileBase::SetCurBlock(TagFileBase *this, _TagFileTag *tag); +void __thiscall TagFileBase::SetCurBlock(TagFileBase *this, const _TagFileTag *tag); // idb unsigned int __thiscall TagFileBase::PrepSeek(TagFileBase *this, unsigned int *offset, TagFileSeekMode mode); -int __stdcall TagFileBase::Seek(TagFileBase *this, int offset, TagFileSeekMode mode); +int __stdcall TagFileBase::Seek(TagFileBase *this, unsigned int offset, TagFileSeekMode mode); // idb unsigned int __stdcall TagFileBase::Tell(TagFileBase *this); // idb unsigned int __stdcall TagFileBase::TellFromEnd(TagFileBase *this); // idb int __stdcall cTagIter::QueryInterface(cTagIter *this, const _GUID *id, void **ppI); // idb @@ -53388,17 +53388,17 @@ ITagFileIter *__stdcall TagFileBase::Iterate(TagFileBase *this); // idb int __stdcall TagFileWrite::OpenMode(TagFileWrite *this); void __thiscall TagFileWrite::TagFileWrite(TagFileWrite *this, const char *filename); // idb void __thiscall TagFileWrite::~TagFileWrite(TagFileWrite *this); // idb -int __stdcall TagFileWrite::OpenBlock(TagFileWrite *this, _TagFileTag *tag, VersionNum *version); +int __stdcall TagFileWrite::OpenBlock(TagFileWrite *this, const _TagFileTag *tag, VersionNum *version); // idb int __stdcall TagFileWrite::CloseBlock(TagFileWrite *this); // idb int __stdcall TagFileWrite::Read(TagFileWrite *this, char *__formal, int a3); // idb -int __stdcall TagFileWrite::Write(TagFileWrite *this, const char *buf, int buflen); // idb +size_t __stdcall TagFileWrite::Write(TagFileWrite *this, const char *buf, size_t buflen); int __stdcall TagFileWrite::Move(TagFileWrite *this, char *buf, int len); // idb TagFileOpenMode __stdcall TagFileRead::OpenMode(TagFileRead *this); // idb void __thiscall TagFileRead::TagFileRead(TagFileRead *this, const char *filename); // idb void __thiscall TagFileRead::~TagFileRead(TagFileRead *this); // idb -int __stdcall TagFileRead::OpenBlock(TagFileRead *this, _TagFileTag *tag, VersionNum *version); +int __stdcall TagFileRead::OpenBlock(TagFileRead *this, const _TagFileTag *tag, VersionNum *version); // idb int __stdcall TagFileRead::CloseBlock(TagFileRead *this); // idb -size_t __stdcall TagFileRead::Read(TagFileRead *this, char *buf, unsigned int buflen); +size_t __stdcall TagFileRead::Read(TagFileRead *this, char *buf, size_t buflen); int __stdcall TagFileRead::Write(TagFileRead *this, const char *__formal, int a3); // idb int __stdcall TagFileRead::Move(TagFileRead *this, char *buf, int buflen); // idb TagFileBase *__cdecl TagFileBase::Open(const char *filename, TagFileOpenMode mode); @@ -53436,11 +53436,11 @@ TagFileRead *__thiscall TagFileRead::`scalar deleting destructor'(TagFileRead *t void __thiscall cHashSet::cHashSet(cHashSet *this, unsigned int n); // idb cHashSet *__thiscall cHashSet::`scalar deleting destructor'(cHashSet *this, char __flags); tHashSetNode__ *__thiscall cHashSet::Insert(cHashSet *this, TagTableEntry *node); -tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, _TagFileTag *key); +tHashSetNode__ *__thiscall cHashSet::Search(cHashSet *this, const _TagFileTag *key); void __thiscall cHashSet::DestroyAll(cHashSet *this); // idb tHashSetNode__ *__thiscall cHashSet::GetFirst(cHashSet *this, tHashSetHandle *Handle); tHashSetNode__ *__thiscall cHashSet::GetNext(cHashSet *this, tHashSetHandle *Handle); -int __thiscall cHashSet::IsEqual(cHashSet *this, _TagFileTag *k1, _TagFileTag *k2); +int __thiscall cHashSet::IsEqual(cHashSet *this, tHashSetKey__ *k1, tHashSetKey__ *k2); // idb // int __cdecl TagHashFunctions::IsEqual(const _TagFileTag *p, const _TagFileTag *q); idb int __thiscall cHashSet::Hash(cHashSet *this, tHashSetKey__ *k); int __cdecl TagHashFunctions::Hash(const _TagFileTag *p); @@ -53454,8 +53454,8 @@ unsigned int __stdcall cMemFile::TellFromEnd(cMemFile *this); // idb ITagFileIter *__stdcall cMemFile::Iterate(cMemFile *this); // idb int __stdcall cMemFileReadWrite::OpenBlock(cMemFileReadWrite *this, const _TagFileTag *tag, VersionNum *version); // idb int __stdcall cMemFileReadWrite::CloseBlock(cMemFileReadWrite *this); // idb -int __stdcall cMemFileReadWrite::Read(cMemFileReadWrite *this, char *buf, int buflen); // idb -int __stdcall cMemFileReadWrite::Write(cMemFileReadWrite *this, const char *buf, int buflen); // idb +size_t __stdcall cMemFileReadWrite::Read(cMemFileReadWrite *this, char *buf, size_t buflen); +size_t __stdcall cMemFileReadWrite::Write(cMemFileReadWrite *this, const char *buf, size_t buflen); int __stdcall cMemFileReadWrite::Move(cMemFileReadWrite *this, char *buf, int buflen); // idb cTagFileFactory *__cdecl CreateMemoryTagFileFactory(); // idb tHashSetNode__ *__thiscall cMemTagTable::GetKey(cMemTagTable *this, tHashSetNode__ *node); @@ -53599,7 +53599,7 @@ int __cdecl unlink(const char *FileName); // void *__cdecl operator new(unsigned int size); idb // size_t __cdecl strspn(const char *Str, const char *Control); // size_t __cdecl strcspn(const char *Str, const char *Control); -// int __cdecl stat_0(const char *const FileName, struct _stat32 *const Stat); +// int __cdecl stat(const char *const FileName, struct _stat32 *const Stat); // _DWORD __cdecl _dosmaperr(_DWORD); weak // int *__cdecl _errno(); // unsigned int *__cdecl __doserrno(); @@ -53640,23 +53640,23 @@ size_t __cdecl _Strftime(char *Buffer, size_t Max_size, const char *Format, cons void __cdecl SimpleTimerOutputResult(const char *pszName, unsigned int totalTime); // idb void __cdecl DiffTimerOutputResult(const char *pszName, unsigned int diffTime); // idb void __cdecl AverageTimerOutputResult(const char *pszName, long double avg, unsigned int max, unsigned int min, unsigned int totalTime, unsigned int iters); // idb -BOOL __stdcall MakeFunctionWritable(void *pfnFunction, unsigned int sizeFunction); +BOOL __stdcall MakeFunctionWritable(void *pfnFunction, SIZE_T sizeFunction); int __stdcall MakeAllCodeWritable(); // idb void __thiscall cThreadLock::cThreadLock(cThreadLock *this); // idb // void __thiscall cThreadLock::~cThreadLock(cThreadLock *this); idb void __thiscall cThreadLock::Lock(cThreadLock *this); // idb void __thiscall cThreadLock::Unlock(cThreadLock *this); // idb int __thiscall cThreadLock::AssertOwnedByCurrentThread(cThreadLock *this); // idb -void __thiscall cThreadEvent::cThreadEvent(cThreadEvent *this, int fManualReset); // idb -void __thiscall cThreadSemaphore::cThreadSemaphore(cThreadSemaphore *this, int initialValue, int maxValue); // idb -BOOL __thiscall cThreadSemaphore::Release(cThreadSemaphore *this, int releaseCount, int *pPreviousCount); -void __thiscall cThreadMutex::cThreadMutex(cThreadMutex *this, int fEstablishInitialOwnership); // idb +void __thiscall cThreadEvent::cThreadEvent(cThreadEvent *this, BOOL fManualReset); +void __thiscall cThreadSemaphore::cThreadSemaphore(cThreadSemaphore *this, LONG initialValue, LONG maxValue); +BOOL __thiscall cThreadSemaphore::Release(cThreadSemaphore *this, LONG releaseCount, int *pPreviousCount); +void __thiscall cThreadMutex::cThreadMutex(cThreadMutex *this, BOOL fEstablishInitialOwnership); BOOL __thiscall cThreadMutex::Release(cThreadMutex *this); void __thiscall cWorkerThread::~cWorkerThread(cWorkerThread *this); // idb BOOL __thiscall cWorkerThread::ThreadExists(cWorkerThread *this); int __stdcall cWorkerThread::InitialThreadProc(cThreadEvent *pv); BOOL __thiscall cWorkerThread::Create(cWorkerThread *this); -void __thiscall cWorkerThread::WaitForClose(cWorkerThread *this, unsigned int dwErrorTimeout); // idb +void __thiscall cWorkerThread::WaitForClose(cWorkerThread *this, DWORD dwErrorTimeout); unsigned int __thiscall cWorkerThread::Call(cWorkerThread *this, unsigned int dwParam, int fBoostPriority); // idb unsigned int __thiscall cWorkerThread::WaitForCall(cWorkerThread *this); // idb int __thiscall cWorkerThread::PeekCall(cWorkerThread *this, unsigned int *pParam); // idb @@ -53901,7 +53901,7 @@ unsigned __int8 *__cdecl PlaneDownsample(unsigned __int8 *pSrc, int sw, int sh); int __cdecl PlaneSize(int w, int h); // idb void __cdecl md_mipmap_set_detail(float detail); // idb double __cdecl md_mipmap_get_detail(); -void __cdecl md_mipmap_render_pgon(mds_pgon *p, _r3s_point **v, grs_bitmap *bm, int color, char type); +void __cdecl md_mipmap_render_pgon(mds_pgon *p, _r3s_point **v, grs_bitmap *bm, unsigned int color, char type); // char *__cdecl strlwr(char *String); int __cdecl mkdir(const char *Path); // int __cdecl chdir(const char *Path); @@ -54000,7 +54000,7 @@ unsigned int __stdcall cHeapDebug::GetSize(cHeapDebug *this, void *p); // idb int __stdcall cHeapDebug::DidAlloc(cHeapDebug *this, char *p); void __stdcall cHeapDebug::HeapMinimize(cHeapDebug *this); // idb unsigned int __stdcall cHeapDebug::AllocEx(cHeapDebug *this, unsigned int size, char *pszFile, int line); -void *__stdcall cHeapDebug::ReallocEx(cHeapDebug *this, void *pOld, size_t newClientSize, const char *pszFile, int line); +void *__stdcall cHeapDebug::ReallocEx(cHeapDebug *this, void *pOld, unsigned int newClientSize, const char *pszFile, int line); // idb void __stdcall cHeapDebug::FreeEx(cHeapDebug *this, char *p, const char *pszFile, int line); int __stdcall cHeapDebug::VerifyAlloc(cHeapDebug *this, char *p); int __stdcall cHeapDebug::VerifyHeap(cHeapDebug *this); // idb @@ -55329,7 +55329,7 @@ void *cAINetProxyBehaviorSet::`vftable' = &loc_420CD4; // weak void *cAIBroadcastProperty::`vftable'{for `cStoredProperty'} = &cAIBroadcastProperty::`vector deleting destructor'; // weak void *cAIBroadcastProperty::`vftable'{for `cUnknownProperty'} = &loc_40C8FB; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019 = &loc_40C8FB; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019 = &loc_40C8FB; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &cProperty::`vector deleting destructor'; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_40C8FB; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55354,7 +55354,7 @@ void *cAIRangedFleeProperty::`vftable'{for `cUnknownProperty'} = &loc_414470; // weak void *cSpecificProperty>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0 = &loc_42270F; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0 = &loc_42270F; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &cProperty::`vector deleting destructor'; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_42270F; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55402,7 +55402,7 @@ void *cAICombatTimingProperty::`vftable'{for `cStoredProperty'} = &cAICombatTimi void *cAICombatTimingProperty::`vftable'{for `cUnknownProperty'} = &loc_40E05C; // weak void *cAICombat::`vftable' = &cAIActorBase::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &loc_40C27A; // weak -void *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165 = &loc_40E05C; // weak +_UNKNOWN *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165 = &loc_40E05C; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_41FC35; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_40E05C; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55427,7 +55427,7 @@ void *cAIAlertResponseProperty::`vftable'{for `cStoredProperty'} = &cAIAlertResp void *cAIAlertResponseProperty::`vftable'{for `cUnknownProperty'} = &loc_4065CD; // weak void *cAIAlertResponse::`vftable' = &cAIActorBase::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0 = &loc_4065CD; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0 = &loc_4065CD; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &cProperty::`vector deleting destructor'; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_4065CD; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55456,7 +55456,7 @@ void *cAISenseCombatResponseProperty::`vftable'{for `cStoredProperty'} = &loc_40 void *cAISenseCombatResponseProperty::`vftable'{for `cUnknownProperty'} = &loc_403855; // weak void *cAISenseCombatResponse::`vftable' = &cAIActorBase::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5 = &loc_403855; // weak +_UNKNOWN *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5 = &loc_403855; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &cProperty::`vector deleting destructor'; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_403855; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55471,7 +55471,7 @@ void *cAIFleeConditionsProperty::`vftable'{for `cStoredProperty'} = &cAIFleeCond void *cAIFleeConditionsProperty::`vftable'{for `cUnknownProperty'} = &loc_419457; // weak void *cAIFlee::`vftable' = &cAIActorBase::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &loc_41C3D7; // weak -void *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc = &loc_419457; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc = &loc_419457; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_41DDB3; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_419457; // weak void *cUnknownProperty::`vftable' = &loc_402031; // weak @@ -55526,7 +55526,7 @@ void *cAISignalResponseProperty::`vftable'{for `cStoredProperty'} = &loc_40EDE5; void *cAISignalResponseProperty::`vftable'{for `cUnknownProperty'} = &loc_419A74; // weak void *cAISignalResponse::`vftable' = &cAIActorBase::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa = &loc_419A74; // weak +_UNKNOWN *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa = &loc_419A74; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_41C71A; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_419A74; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55636,7 +55636,7 @@ void *IAINonCombatDmgRespProperty::`vftable' = &j___purecall; // weak void *cAIConversationDescProperty::`vftable'{for `cStoredProperty'} = &loc_401055; // weak void *cAIConversationDescProperty::`vftable'{for `cUnknownProperty'} = &loc_401CBC; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &loc_4117CA; // weak -void *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2 = &loc_401CBC; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2 = &loc_401CBC; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_405740; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_401CBC; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55725,7 +55725,7 @@ void *cProperty::` void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak void *cCTUnaggregated::`vftable' = &cCTUnaggregated::QueryInterface; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &cSpecificProperty>>::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab = &loc_41E268; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab = &loc_41E268; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_41E60A; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_41E268; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -55737,7 +55737,7 @@ void *cProperty::`vftable' = &loc_415F0F; // weak void *cCTUnaggregated::`vftable' = &loc_415F0F; // weak void *cSpecificProperty>>::`vftable'{for `cStoredProperty'} = &loc_414D30; // weak -void *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8 = &loc_40FB32; // weak +_UNKNOWN *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8 = &loc_40FB32; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_402531; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_40FB32; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -57055,7 +57055,7 @@ void *cProperty: void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak void *cCTUnaggregated::`vftable' = &cCTUnaggregated::QueryInterface; // weak void *cSpecificProperty::`vftable'{for `cStoredProperty'} = &cSpecificProperty::`vector deleting destructor'; // weak -void *___7__cSpecificProperty_UIMotPlayerLimbOffsetsProperty___1_IID_IMotPlayerLimbOffsetsProperty__3U_GUID__BPAUsMPlayerLimbOffsets__VcMotPlayerLimbOffsetsStore____6B__cUnknownProperty_UIMotPlayerLimbOffsetsProperty___1_IID_IMotPlayerLimbOffsetsPropertfa92c674 = &loc_412A26; // weak +_UNKNOWN *___7__cSpecificProperty_UIMotPlayerLimbOffsetsProperty___1_IID_IMotPlayerLimbOffsetsProperty__3U_GUID__BPAUsMPlayerLimbOffsets__VcMotPlayerLimbOffsetsStore____6B__cUnknownProperty_UIMotPlayerLimbOffsetsProperty___1_IID_IMotPlayerLimbOffsetsPropertfa92c674 = &loc_412A26; // weak void *cProperty::`vftable'{for `cStoredProperty'} = &loc_41F6D1; // weak void *cProperty::`vftable'{for `cUnknownProperty'} = &loc_412A26; // weak void *cUnknownProperty::`vftable' = &cCTUnaggregated::QueryInterface; // weak @@ -57226,26 +57226,26 @@ const sChipDot ChipPart[8] = { 0.0, -0.0062500001 }, { 0.0, -0.003125 } }; // idb -float dword_99EAD4[18] = +int dword_99EAD4[18] = { - -0.25, - 0.0, - -0.21875, - 0.0, - -0.1875, - 0.0, - -0.15625, - 0.0, - -0.125, - 0.0, - -0.09375, - 0.0, - -0.0062500001, - 0.0, - -0.003125, - 0.0, - 0.0, - 0.0 + -1098907648, + 0, + -1101004800, + 0, + -1103101952, + 0, + -1105199104, + 0, + -1107296256, + 0, + -1111490560, + 0, + -1144206131, + 0, + -1152594739, + 0, + 0, + 0 }; // weak void *cFrostedEdgesEffect::`vftable' = &loc_40339B; // weak void *IRemoteCameraEffect::`vftable' = &j___purecall; // weak @@ -78224,12 +78224,12 @@ ObjShapeFuncs g_aObjShapeFuncs[7] = &GetDefaultObjOffsetVhot } }; // idb -int (__cdecl *off_9C4284)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultObjRelBBox; // weak -int (__cdecl *off_9C4288)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultObjOffsetBBox; // weak -int (__cdecl *off_9C428C)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultWorldBBox; // weak -int (__cdecl *off_9C4290)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultObjRelBBox; // weak -int (__cdecl *off_9C4294)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultObjRelVhot; // weak -int (__cdecl *off_9C4298)(_DWORD, _DWORD, _DWORD, _DWORD) = &GetDefaultObjOffsetVhot; // weak +int (__cdecl *off_9C4284)(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax) = &GetDefaultObjRelBBox; // weak +int (__cdecl *off_9C4288)(int obj, int idx, mxs_vector *bmin, mxs_vector *bmax) = &GetDefaultObjOffsetBBox; // weak +int (__cdecl *off_9C428C)(int obj, int idx, mxs_vector *bmin, mxs_vector *bmax) = &GetDefaultWorldBBox; // weak +int (__cdecl *off_9C4290)(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax) = &GetDefaultObjRelBBox; // weak +void (__cdecl *off_9C4294)(int objID, int idx, int vhot, mxs_vector *pos) = &GetDefaultObjRelVhot; // weak +void (__cdecl *off_9C4298)(int objID, int idx, int vhot, mxs_vector *pos) = &GetDefaultObjOffsetVhot; // weak char aRPrjThief2Skup_2481[] = "r:\\prj\\thief2\\skup\\thief2\\src\\render\\objshape.cpp"; // idb char aRPrjThief2Skup_2482[] = "r:\\prj\\thief2\\skup\\thief2\\src\\render\\objshape.cpp"; // idb char aRPrjThief2Skup_2483[] = "r:\\prj\\thief2\\skup\\thief2\\src\\render\\objshape.cpp"; // idb @@ -78600,7 +78600,7 @@ int gCanExit = 1; // idb unsigned int panel_factory_id = 4294967295u; // idb const _GUID *Clients[5] = { &GUID_NULL, &LOOPID_ScrnMan, &LOOPID_UI, &LOOPID_Panel, &LOOPID_Sound }; // idb _ScrnManContext def_scrnparm = { { NULL, &min_scrnmode, &max_scrnmode }, NULL }; // idb -_GUImethods methods_0 = { &panel_gui_setup, &panel_gui_clear, &panel_gui_done, NULL }; // idb +_GUImethods methods = { &panel_gui_setup, &panel_gui_clear, &panel_gui_done, NULL }; // idb char aRPrjThief2Skup_2430[] = "r:\\prj\\thief2\\skup\\thief2\\src\\ui\\panlmode.cpp"; // idb char aRPrjThief2Skup_2431[] = "r:\\prj\\thief2\\skup\\thief2\\src\\ui\\panlmode.cpp"; // idb char aRPrjThief2Skup_2432[] = "r:\\prj\\thief2\\skup\\thief2\\src\\ui\\panlmode.cpp"; // idb @@ -85266,9 +85266,9 @@ _r3s_point *g_apPt_0[4] = (_r3s_point *)0xB992F8, (_r3s_point *)0xB99324 }; // idb -void *off_9DB330 = (void *)0xB992CC; // weak -void *off_9DB334 = (void *)0xB992F8; // weak -void *off_9DB338 = (void *)0xB99324; // weak +_UNKNOWN *off_9DB330 = (_UNKNOWN *)0xB992CC; // weak +_UNKNOWN *off_9DB334 = (_UNKNOWN *)0xB992F8; // weak +_UNKNOWN *off_9DB338 = (_UNKNOWN *)0xB99324; // weak mxs_vector *g_apSnowAng1[9] = { &g_aSnowOrient, @@ -135523,7 +135523,7 @@ int brushRaws[24] = 21514312, 18915456 }; // idb -void *off_AF02A4 = (void *)0x120A080; // weak +_UNKNOWN *off_AF02A4 = (_UNKNOWN *)0x120A080; // weak int brush_pt_cnt = -1; // idb int editbr_color_mode = 2; // idb int editbr_filter = 4080; // idb @@ -169952,7 +169952,7 @@ int texmem_cur_loadid; // idb int texmem_find_align; // idb int texmem_out_of_space; // idb grs_bitmap *texmem_default_maps[2]; // idb -grs_bitmap *dword_B9806C; // idb +grs_bitmap *tm; // idb grs_bitmap *texmem_inviso_maps; // idb int tm_cnt; // idb int ectsSecretLoadIdx; // idb @@ -171322,7 +171322,7 @@ int auto_roombuild; // idb mxs_vector vbrush_hack_delta; // idb int auto_portalize; // idb _LGadRoot *root_0; // idb -mxs_vector bounds_0[2]; // idb +mxs_vector bounds[2]; // idb int dword_DF82C4; // weak int dword_DF82C8; // weak int dword_DF82CC; // weak @@ -173209,8 +173209,8 @@ int hilight_split_objs; // idb int mCellRefSys; // idb sCTimer g_aCTimers[4]; // idb int g_iCTimerFrames; // idb -_CmdTerm CmdTerm_0; // idb -_bugterm bugterm_0; // idb +_CmdTerm CmdTerm; // idb +_bugterm bugterm; // idb AmbientRunTime ambRTData[256]; // idb int dword_151C324[616]; // weak int hAuxSch2; // idb @@ -173654,12 +173654,12 @@ unsigned int __cdecl Rand250() // 9AE460: using guessed type unsigned __int8 g_R250IncrementTable[252]; //----- (00437F14) -------------------------------------------------------- -void __cdecl Rand250Seed(int seed) +void __cdecl Rand250Seed(unsigned int seed) { unsigned int v1; // edi unsigned int v2; // esi unsigned int v3; // esi - int hi; // [esp+8h] [ebp-24h] + unsigned int hi; // [esp+8h] [ebp-24h] unsigned int bit; // [esp+Ch] [ebp-20h] int i; // [esp+18h] [ebp-14h] int ia; // [esp+18h] [ebp-14h] @@ -173735,7 +173735,7 @@ int __cdecl RandRange(int low, int high) //----- (00438173) -------------------------------------------------------- int __cdecl UnrecordedRand() { - unsigned int Time; // eax + DWORD Time; // eax if ( !fInited ) { @@ -173747,7 +173747,7 @@ int __cdecl UnrecordedRand() } //----- (00438260) -------------------------------------------------------- -void *__cdecl dark_gr_malloc(int n) +void *__cdecl dark_gr_malloc(unsigned int n) { return j__malloc_db(n, file, 0); } @@ -174208,7 +174208,7 @@ void __cdecl ectsAnimTxtCheckLoad(IRes *me, int portal_tmap, char *path, int txt IRes *nxt_framea; // [esp+Ch] [ebp-34h] char base_align; // [esp+10h] [ebp-30h] int old_cback_idx; // [esp+14h] [ebp-2Ch] - char name[33]; // [esp+18h] [ebp-28h] BYREF + char name[36]; // [esp+18h] [ebp-28h] BYREF ectsAnimInfo *animData; // [esp+3Ch] [ebp-4h] if ( me ) @@ -174492,7 +174492,7 @@ void __cdecl ectsAnimTxtRemapAll(int *mapping, int cnt) //----- (0043986E) -------------------------------------------------------- int __cdecl ectsAnimTxtGetRawSize(IRes *me, int *fr) { - int v3; // [esp+0h] [ebp-18h] + grs_bitmap *v3; // [esp+0h] [ebp-18h] grs_bitmap *bm; // [esp+4h] [ebp-14h] int i; // [esp+8h] [ebp-10h] ectsAnimInfo *animData; // [esp+Ch] [ebp-Ch] @@ -174521,10 +174521,10 @@ int __cdecl ectsAnimTxtGetRawSize(IRes *me, int *fr) } else { - v3 = ((int (__thiscall *)(IRes *, IRes *))me->Lock)(me, me); + v3 = (grs_bitmap *)((int (__thiscall *)(IRes *, IRes *))me->Lock)(me, me); if ( v3 ) { - size = *(__int16 *)(v3 + 10) * *(__int16 *)(v3 + 8); + size = v3->h * v3->w; frames = 1; } ((void (__thiscall *)(IRes *, IRes *))me->Unlock)(me, me); @@ -175476,30 +175476,28 @@ void __thiscall cDelegatingDataOps::~cDelegatingDataOps(cDelegatingDataOps *this //----- (0043BB60) -------------------------------------------------------- sDatum *__stdcall cDelegatingDataOps::New(cDelegatingDataOps *this, sDatum *result) { - char v3[4]; // [esp+0h] [ebp-4h] BYREF + _BYTE v3[4]; // [esp+0h] [ebp-4h] BYREF if ( !this->mpOps ) _CriticalMsg(aMpops, aRPrjThief2Skup_31, 0xCBu); result->value = this->mpOps->New(this->mpOps, v3)->value; return result; } -// 43BB60: using guessed type char var_4[4]; //----- (0043BBD0) -------------------------------------------------------- sDatum *__stdcall cDelegatingDataOps::CopyNew(cDelegatingDataOps *this, sDatum *result, sDatum __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-4h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-4h] BYREF if ( !this->mpOps ) _CriticalMsg(aMpops, aRPrjThief2Skup_31, 0xCDu); - result->value = *(void **)((int (__thiscall *)(IDataOps *, IDataOps *, char *, void *))this->mpOps->CopyNew)( + result->value = *(void **)((int (__thiscall *)(IDataOps *, IDataOps *, _BYTE *, void *))this->mpOps->CopyNew)( this->mpOps, this->mpOps, v4, __$ReturnUdt.value); return result; } -// 43BBD0: using guessed type char var_4[4]; //----- (0043BC40) -------------------------------------------------------- int __stdcall cDelegatingDataOps::Delete(cDelegatingDataOps *this, sDatum val) @@ -175920,7 +175918,7 @@ sDatum *__stdcall cCompactArrayPropertyStore::Obj2Idx(this, __$ReturnUdt); @@ -175935,7 +175933,6 @@ sDatum *__stdcall cCompactArrayPropertyStorevalue = cDABase>::operator[](&this->mValues, idx)->value; return result; } -// 43C730: using guessed type char var_8[4]; //----- (0043C7F0) -------------------------------------------------------- int __stdcall cCompactArrayPropertyStore::Delete( @@ -175992,7 +175989,7 @@ int __stdcall cCompactArrayPropertyStore::S { sDatum *v3; // eax void *v5; // esi - char v6[4]; // [esp+4h] [ebp-8h] BYREF + _BYTE v6[4]; // [esp+4h] [ebp-8h] BYREF int idx; // [esp+8h] [ebp-4h] idx = cCompactArrayPropertyStore::Obj2Idx(this, obj); @@ -176006,7 +176003,7 @@ int __stdcall cCompactArrayPropertyStore::S { idx = cCompactArrayPropertyStore::NewIdx(this); this->mMap.SetIndex(&this->mMap, obj, idx); - v5 = *(void **)((int (__stdcall *)(cDelegatingDataOps *, char *, void *))this->mOps.CopyNew)( + v5 = *(void **)((int (__stdcall *)(cDelegatingDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v6, val.value); @@ -176015,7 +176012,6 @@ int __stdcall cCompactArrayPropertyStore::S return 0; } } -// 43C920: using guessed type char var_8[4]; //----- (0043CA00) -------------------------------------------------------- sDatum *__stdcall cCompactArrayPropertyStore::Copy( @@ -176026,7 +176022,7 @@ sDatum *__stdcall cCompactArrayPropertyStore::NewIdx(this); this->mMap.SetIndex(&this->mMap, __$ReturnUdt, targidx); - v6 = *(void **)((int (__stdcall *)(cDelegatingDataOps *, char *, void *))this->mOps.CopyNew)( + v6 = *(void **)((int (__stdcall *)(cDelegatingDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -176061,7 +176057,6 @@ sDatum *__stdcall cCompactArrayPropertyStore::Reset( @@ -176156,7 +176151,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -176168,7 +176163,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 43CD80: using guessed type char var_C[4]; //----- (0043CE10) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -176195,7 +176189,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -176205,7 +176199,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cDelegatingDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 43CE70: using guessed type char var_8[4]; //----- (0043CF00) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -176337,7 +176330,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -176365,7 +176358,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 43D2EC: variable 'v4' is possibly undefined -// 43D250: using guessed type char var_10[4]; //----- (0043D350) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -176728,12 +176720,11 @@ int __stdcall cDelegatingPropertyStore::SetID(cDelegatingPropertyStore *this, in //----- (0043DBD0) -------------------------------------------------------- sDatum *__stdcall cDelegatingPropertyStore::Create(cDelegatingPropertyStore *this, sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-4h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-4h] BYREF result->value = this->mpStore->Create(this->mpStore, v4, __$ReturnUdt)->value; return result; } -// 43DBD0: using guessed type char var_4[4]; //----- (0043DC10) -------------------------------------------------------- int __stdcall cDelegatingPropertyStore::Delete(cDelegatingPropertyStore *this, int obj) @@ -176772,12 +176763,11 @@ sDatum *__stdcall cDelegatingPropertyStore::Copy( int __$ReturnUdt, int targ) { - char v5[4]; // [esp+0h] [ebp-4h] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-4h] BYREF result->value = this->mpStore->Copy(this->mpStore, v5, __$ReturnUdt, targ)->value; return result; } -// 43DCD0: using guessed type char var_4[4]; //----- (0043DD10) -------------------------------------------------------- int __stdcall cDelegatingPropertyStore::Reset(cDelegatingPropertyStore *this) @@ -177611,7 +177601,7 @@ void __cdecl SFX_Refresh_Config() { if ( config_get_raw(aAllOneSound, 0, 0) ) { - config_get_raw(aAllOneSound_0, dummy_sound, 64); + config_get_raw(aAllOneSound_0, dummy_sound, 0x40u); if ( !dummy_sound[0] ) strcpy(dummy_sound, Source); } @@ -177710,7 +177700,7 @@ int __cdecl SFXInit() pSoundPath->AddPathTrees(pSoundPath, aSnd2, 0); pSoundPath->AddPathTrees(pSoundPath, aSnd_2, 0); pSoundPath->Ready(pSoundPath); - config_get_raw(aSnd3d, methodName, 256); + config_get_raw(aSnd3d, methodName, 0x100u); if ( !_strcmpi(methodName, String2) ) g_SFX_Device = 2; createOk = 0; @@ -178598,14 +178588,14 @@ void __cdecl SFX_Slam_Dist(int hnd, int distance, int force_update) // B56960: using guessed type int dword_B56960[872]; //----- (00440E5A) -------------------------------------------------------- -void __cdecl SFX_Slam_Dist_BF(int hnd, int distance, float blocking_factor, int force_update) +void __cdecl SFX_Slam_Dist_BF(int hnd, int distance, int blocking_factor, int force_update) { unsigned int millisec_unrecorded; // eax if ( dword_B56928[28 * hnd] < 0 ) _CriticalMsg(aAttemptToDista_0, aRPrjThief2Skup_2744, 0x5AAu); dword_B56928[28 * hnd] = distance; - dword_B56960[28 * hnd] = blocking_factor; + dword_B56960[28 * hnd] = *(float *)&blocking_factor; if ( force_update ) { if ( dword_B56918[28 * hnd] ) @@ -179372,7 +179362,7 @@ ISndSample *__cdecl CreateMemSoundSourceLooped( void (__cdecl *endCB)(ISndSample *, void *), void *pEndCBData, ISndSource **ppSndSrc, - int nLoops, + unsigned int nLoops, void (__cdecl *loopCB)(ISndSource *, unsigned int *), void *pLoopCBData) { @@ -180069,9 +180059,9 @@ VFILE *__cdecl vfopen(const char *file, const char *mode) } //----- (00444543) -------------------------------------------------------- -unsigned int __cdecl vfread(void *pTo, unsigned int s, unsigned int n, VFILE *pVFile) +size_t __cdecl vfread(void *pTo, size_t s, size_t n, VFILE *pVFile) { - unsigned int sz; // [esp+0h] [ebp-4h] + size_t sz; // [esp+0h] [ebp-4h] if ( !pVFile->pBuf ) return fread(pTo, s, n, pVFile->file); @@ -180086,7 +180076,7 @@ unsigned int __cdecl vfread(void *pTo, unsigned int s, unsigned int n, VFILE *pV } //----- (004445E2) -------------------------------------------------------- -size_t __cdecl vfwrite(const void *pFrom, unsigned int s, unsigned int n, VFILE *pVFile) +size_t __cdecl vfwrite(const void *pFrom, size_t s, size_t n, VFILE *pVFile) { if ( pVFile->pBuf ) _CriticalMsg(aPvfilePbuf, aRPrjThief2Skup_2705, 0x80u); @@ -180346,7 +180336,7 @@ unsigned int __thiscall BufTagFileBase::PrepSeek(BufTagFileBase *this, unsigned } //----- (00444C0F) -------------------------------------------------------- -int __stdcall BufTagFileBase::Seek(BufTagFileBase *this, int offset, TagFileSeekMode mode) +int __stdcall BufTagFileBase::Seek(BufTagFileBase *this, unsigned int offset, TagFileSeekMode mode) { unsigned int v4; // eax int blockptr; // [esp+0h] [ebp-8h] @@ -180354,7 +180344,7 @@ int __stdcall BufTagFileBase::Seek(BufTagFileBase *this, int offset, TagFileSeek if ( this->block ) { - check = BufTagFileBase::PrepSeek(this, (unsigned int *)&offset, mode); + check = BufTagFileBase::PrepSeek(this, &offset, mode); if ( check >= 0 && (check <= 0 || this->OpenMode(this)) ) { vfseek(this->file, offset, 0); @@ -180586,7 +180576,7 @@ int __stdcall BufTagFileWrite::Read(BufTagFileWrite *this, char *__formal, int a } //----- (0044519E) -------------------------------------------------------- -int __stdcall BufTagFileWrite::Write(BufTagFileWrite *this, const char *buf, int buflen) +int __stdcall BufTagFileWrite::Write(BufTagFileWrite *this, const char *buf, unsigned int buflen) { int size; // [esp+0h] [ebp-8h] int len; // [esp+4h] [ebp-4h] @@ -181102,7 +181092,7 @@ tHashSetNode__ *__thiscall cHashSet::Search( cHashSet *this, - _TagFileTag *key) + const _TagFileTag *key) { return cHashSetBase::Search(this, (tHashSetKey__ *)key); } @@ -181207,10 +181197,10 @@ tHashSetNode__ *__thiscall cHashSetBase::GetNext(cHashSetBase *this, tHashSetHan //----- (00446790) -------------------------------------------------------- int __thiscall cHashSet::IsEqual( cHashSet *this, - _TagFileTag *k1, - _TagFileTag *k2) + tHashSetKey__ *k1, + tHashSetKey__ *k2) { - return BufTagHashFunctions::IsEqual(k1, k2); + return BufTagHashFunctions::IsEqual((const _TagFileTag *)k1, (const _TagFileTag *)k2); } //----- (004467E0) -------------------------------------------------------- @@ -181233,7 +181223,7 @@ _iobuf *__cdecl FindFreeFile(char *buff, char *prefix, char *suffix) _iobuf *fp; // [esp+0h] [ebp-110h] _iobuf *fpa; // [esp+0h] [ebp-110h] int num; // [esp+4h] [ebp-10Ch] - int ps; // [esp+8h] [ebp-108h] + size_t ps; // [esp+8h] [ebp-108h] char fname[260]; // [esp+Ch] [ebp-104h] BYREF num = 0; @@ -181286,7 +181276,7 @@ void __cdecl WriteBugInfo(_iobuf *fp, char *bugtext) if ( !bugUser ) bugUser = aUnnamed_2; sprintf(bugDate, "%d/%d/%d", pCurrentTime->tm_mon + 1, pCurrentTime->tm_mday, pCurrentTime->tm_year); - config_get_raw(aGame_10, gamestring, 32); + config_get_raw(aGame_10, gamestring, 0x20u); player = j__get_player_object(); if ( player ) { @@ -181316,10 +181306,10 @@ void __cdecl WriteBugInfo(_iobuf *fp, char *bugtext) void __cdecl ReportBug(char *buf) { _iobuf *fp; // [esp+0h] [ebp-204h] - char bugroot[255]; // [esp+4h] [ebp-200h] BYREF - char bugdir[255]; // [esp+104h] [ebp-100h] BYREF + char bugroot[256]; // [esp+4h] [ebp-200h] BYREF + char bugdir[256]; // [esp+104h] [ebp-100h] BYREF - config_get_raw(aBugrepDir, bugdir, 255); + config_get_raw(aBugrepDir, bugdir, 0xFFu); sprintf(bugroot, "%s\\bugs.txt", bugdir); fp = fopen(bugroot, aAt); if ( fp ) @@ -181349,10 +181339,10 @@ unsigned __int8 __cdecl bugterm_textbox_cb(_LGadTextBox *box, int event, int evd if ( evdata == 269 ) { j__Status(s); - if ( (bugterm_0.statebits & 1) != 0 ) + if ( (bugterm.statebits & 1) != 0 ) { j__SimStateUnpause(); - bugterm_0.statebits &= ~1u; + bugterm.statebits &= ~1u; } ((void (__thiscall *)(IInputBinder *, IInputBinder *, unsigned int *))g_pInputBinder->GetContext)( g_pInputBinder, @@ -181364,9 +181354,9 @@ unsigned __int8 __cdecl bugterm_textbox_cb(_LGadTextBox *box, int event, int evd g_pInputBinder, 1, 1); - if ( strlen(bugterm_0.cmdbuf) ) + if ( strlen(bugterm.cmdbuf) ) { - j__ReportBug(bugterm_0.cmdbuf); + j__ReportBug(bugterm.cmdbuf); j__Status(aBugReported); } *text = 0; @@ -181396,18 +181386,18 @@ unsigned __int8 __cdecl bugterm_textbox_cb(_LGadTextBox *box, int event, int evd if ( clear ) { TextGadgUnfocus(box != 0 ? (_TextGadg *)box : 0); - if ( (bugterm_0.flags & 1) != 0 ) - region_set_invisible(&bugterm_0.root.box.r, 1u); - if ( (bugterm_0.statebits & 1) != 0 ) + if ( (bugterm.flags & 1) != 0 ) + region_set_invisible(&bugterm.root.box.r, 1u); + if ( (bugterm.statebits & 1) != 0 ) { j__SimStateUnpause(); - bugterm_0.statebits &= ~1u; + bugterm.statebits &= ~1u; } } - else if ( (bugterm_0.statebits & 1) == 0 ) + else if ( (bugterm.statebits & 1) == 0 ) { j__SimStatePause(); - bugterm_0.statebits |= 1u; + bugterm.statebits |= 1u; } } return update; @@ -181419,11 +181409,11 @@ void __cdecl CreateBugTerminal(_LGadRoot *root, Rect *bounds, unsigned int flags _LGadTextBoxDesc desc; // [esp+0h] [ebp-40h] BYREF _LGadTextBoxDesc tdesc; // [esp+20h] [ebp-20h] BYREF - if ( (bugterm_0.statebits & 2) != 0 ) + if ( (bugterm.statebits & 2) != 0 ) j__DestroyBugTerminal(); - memset(&bugterm_0, 0, sizeof(bugterm_0)); + memset(&bugterm, 0, sizeof(bugterm)); LGadSetupSubRoot( - &bugterm_0.root, + &bugterm.root, root, bounds->ul.x, bounds->ul.y, @@ -181432,34 +181422,34 @@ void __cdecl CreateBugTerminal(_LGadRoot *root, Rect *bounds, unsigned int flags memset(&tdesc, 0, sizeof(tdesc)); tdesc.bounds.lr = j__MakePointInline(bounds->lr.x - bounds->ul.x, bounds->lr.y - bounds->ul.y); tdesc.bounds.ul = j__MakePointInline(0, 0xFu); - tdesc.editbuf = bugterm_0.cmdbuf; + tdesc.editbuf = bugterm.cmdbuf; tdesc.editbuflen = 1900; - bugterm_0.cmdbuf[0] = 0; + bugterm.cmdbuf[0] = 0; tdesc.flags = 6; - tdesc.cb = j__bugterm_textbox_cb; - LGadCreateTextBoxDesc(&bugterm_0.textbox, &bugterm_0.root, &tdesc); - bugterm_0.textbox.gadg.speckeys = speckeys; - bugterm_0.textbox.gadg.butt.box.box_flags |= 4u; + tdesc.cb = (unsigned __int8 (__cdecl *)(_LGadTextBox *, int, int, void *))j__bugterm_textbox_cb; + LGadCreateTextBoxDesc(&bugterm.textbox, &bugterm.root, &tdesc); + bugterm.textbox.gadg.speckeys = speckeys; + bugterm.textbox.gadg.butt.box.box_flags |= 4u; memset(&desc, 0, sizeof(desc)); desc.bounds.lr = j__MakePointInline(bounds->lr.x - bounds->ul.x, 0xFu); desc.bounds.ul = j__MakePointInline(0, 0); - desc.editbuf = bugterm_0.titlebuf; + desc.editbuf = bugterm.titlebuf; desc.editbuflen = 256; - sprintf(bugterm_0.titlebuf, aEnterBugReport); - LGadCreateTextBoxDesc(&bugterm_0.titlebox, &bugterm_0.root, &desc); - bugterm_0.titlebox.gadg.butt.box.box_flags |= 4u; - bugterm_0.titlebox.gadg.edit &= 0xFFFAu; - bugterm_0.statebits = 2; - bugterm_0.flags = flags; + sprintf(bugterm.titlebuf, aEnterBugReport); + LGadCreateTextBoxDesc(&bugterm.titlebox, &bugterm.root, &desc); + bugterm.titlebox.gadg.butt.box.box_flags |= 4u; + bugterm.titlebox.gadg.edit &= 0xFFFAu; + bugterm.statebits = 2; + bugterm.flags = flags; if ( (flags & 2) != 0 ) { j__bugterm_focus(); } else if ( (flags & 1) != 0 ) { - region_set_invisible(&bugterm_0.root.box.r, 1u); + region_set_invisible(&bugterm.root.box.r, 1u); } - LGadDrawBox(&bugterm_0.root.box, 0); + LGadDrawBox(&bugterm.root.box, 0); j__bugterm_setup_cmds(); } // 403C65: using guessed type int j__bugterm_focus(void); @@ -181470,12 +181460,12 @@ int DestroyBugTerminal() { unsigned int statebits; // eax - statebits = bugterm_0.statebits; - LOBYTE(statebits) = bugterm_0.statebits & 0xFD; - bugterm_0.statebits = statebits; - LGadDestroyTextBox(&bugterm_0.textbox); - LGadDestroyTextBox(&bugterm_0.titlebox); - return LGadDestroyRoot(&bugterm_0.root); + statebits = bugterm.statebits; + LOBYTE(statebits) = bugterm.statebits & 0xFD; + bugterm.statebits = statebits; + LGadDestroyTextBox(&bugterm.textbox); + LGadDestroyTextBox(&bugterm.titlebox); + return LGadDestroyRoot(&bugterm.root); } //----- (00447031) -------------------------------------------------------- @@ -181485,18 +181475,18 @@ unsigned int bugterm_focus() unsigned int context; // [esp+8h] [ebp-8h] BYREF char *buf; // [esp+Ch] [ebp-4h] - buf = bugterm_0.cmdbuf; - result = bugterm_0.statebits & 2; - if ( (bugterm_0.statebits & 2) != 0 ) + buf = bugterm.cmdbuf; + result = bugterm.statebits & 2; + if ( (bugterm.statebits & 2) != 0 ) { strcpy(buf, byte_B57AE8); - region_set_invisible(&bugterm_0.root.box.r, 0); - bugterm_0.textbox.gadg.cursor = move_cursor_into_command(buf, 1900); - TextGadgUpdate(&bugterm_0.textbox.gadg); - TextGadgFocus(&bugterm_0.textbox.gadg); - bugterm_0.textbox.gadg.edit &= ~4u; - LGadDrawBox(&bugterm_0.textbox.gadg.butt.box, 0); - LGadDrawBox(&bugterm_0.titlebox.gadg.butt.box, 0); + region_set_invisible(&bugterm.root.box.r, 0); + bugterm.textbox.gadg.cursor = move_cursor_into_command(buf, 1900); + TextGadgUpdate(&bugterm.textbox.gadg); + TextGadgFocus(&bugterm.textbox.gadg); + bugterm.textbox.gadg.edit &= ~4u; + LGadDrawBox(&bugterm.textbox.gadg.butt.box, 0); + LGadDrawBox(&bugterm.titlebox.gadg.butt.box, 0); ((void (__thiscall *)(IInputBinder *, IInputBinder *, unsigned int *))g_pInputBinder->GetContext)( g_pInputBinder, g_pInputBinder, @@ -181508,7 +181498,7 @@ unsigned int bugterm_focus() 16, 1); result = j__SimStatePause(); - bugterm_0.statebits |= 1u; + bugterm.statebits |= 1u; } return result; } @@ -181516,7 +181506,7 @@ unsigned int bugterm_focus() //----- (00447125) -------------------------------------------------------- int __cdecl move_cursor_into_command(char *cmd, int max_len) { - int len; // [esp+0h] [ebp-8h] + signed int len; // [esp+0h] [ebp-8h] char *space; // [esp+4h] [ebp-4h] if ( !cmd ) @@ -181778,7 +181768,7 @@ void __thiscall cModalButtonPanel::cModalButtonPanel( lcdesc->p = cModalButtonPanel::cClient::FactoryFunc; descs[0] = lcdesc; descs[1] = 0; - LoopFactory = CreateLoopFactory((sLoopClientDesc **)descs); + LoopFactory = CreateLoopFactory(descs); cAutoIPtr::cAutoIPtr(&factory, LoopFactory); Aggregated = (ILoopManager *)_AppGetAggregated(&IID_ILoopManager); cAutoIPtr::cAutoIPtr(&pLoopMan, Aggregated); @@ -182074,7 +182064,7 @@ void __cdecl CameraSwitchProcess(Camera *cam, int DoFlash, int newobj) gNoMoveKeys = cam->mode != FIRST_PERSON; if ( gNoMoveKeys ) { - if ( config_get_raw(aPlayerModel_0, buf, 80) ) + if ( config_get_raw(aPlayerModel_0, buf, 0x50u) ) { buf[79] = 0; player_object = j__get_player_object(); @@ -182082,7 +182072,7 @@ void __cdecl CameraSwitchProcess(Camera *cam, int DoFlash, int newobj) } if ( j__GetPlayerMode() == kPM_Crouch ) { - if ( config_get_raw(aPlayerCrouchMo, buf, 80) ) + if ( config_get_raw(aPlayerCrouchMo, buf, 0x50u) ) { buf[79] = 0; v4 = j__get_player_object(); @@ -182342,9 +182332,9 @@ void __cdecl CameraNextMode(Camera *cam) } //----- (00448CEA) -------------------------------------------------------- -void __cdecl CameraSetMode(Camera *cam, int mode) +void __cdecl CameraSetMode(Camera *cam, eCameraMode mode) { - if ( mode < 8 ) + if ( mode < MAX_CAMERA_MODE ) cam->mode = mode; else DbgReportWarning(aAttemptToSetIn); @@ -182368,11 +182358,11 @@ int __cdecl CameraGetObjID(Camera *cam) //----- (00448D2B) -------------------------------------------------------- void __cdecl CameraSave(Camera *cam, char *str) { - unsigned int v2; // eax + size_t v2; // eax mxs_vector pos; // [esp+0h] [ebp-138h] BYREF mxs_angvec ang; // [esp+Ch] [ebp-12Ch] BYREF char buf[256]; // [esp+14h] [ebp-124h] BYREF - char name_buf[30]; // [esp+114h] [ebp-24h] BYREF + char name_buf[32]; // [esp+114h] [ebp-24h] BYREF int fh; // [esp+134h] [ebp-4h] if ( str && *str ) @@ -183457,10 +183447,10 @@ unsigned __int8 __cdecl cmdterm_textbox_cb(_LGadTextBox *box, int event, int evd break; case 269: j__Status(byte_B57EFC); - if ( (CmdTerm_0.statebits & 1) != 0 ) + if ( (CmdTerm.statebits & 1) != 0 ) { j__SimStateUnpause(); - CmdTerm_0.statebits &= ~1u; + CmdTerm.statebits &= ~1u; } ((void (__thiscall *)(IInputBinder *, IInputBinder *, unsigned int *))g_pInputBinder->GetContext)( g_pInputBinder, @@ -183509,18 +183499,18 @@ unsigned __int8 __cdecl cmdterm_textbox_cb(_LGadTextBox *box, int event, int evd if ( clear ) { TextGadgUnfocus(box != 0 ? (_TextGadg *)box : 0); - if ( (CmdTerm_0.flags & 1) != 0 ) - region_set_invisible(&CmdTerm_0.root.box.r, 1u); - if ( (CmdTerm_0.statebits & 1) != 0 ) + if ( (CmdTerm.flags & 1) != 0 ) + region_set_invisible(&CmdTerm.root.box.r, 1u); + if ( (CmdTerm.statebits & 1) != 0 ) { j__SimStateUnpause(); - CmdTerm_0.statebits &= ~1u; + CmdTerm.statebits &= ~1u; } } - else if ( (CmdTerm_0.statebits & 1) == 0 ) + else if ( (CmdTerm.statebits & 1) == 0 ) { j__SimStatePause(); - CmdTerm_0.statebits |= 1u; + CmdTerm.statebits |= 1u; } } return update; @@ -183622,7 +183612,7 @@ char *__cdecl history_get(int offset) //----- (0044B313) -------------------------------------------------------- int __cdecl move_cursor_into_command_0(char *cmd, int max_len) { - int len; // [esp+0h] [ebp-8h] + signed int len; // [esp+0h] [ebp-8h] char *space; // [esp+4h] [ebp-4h] if ( !cmd ) @@ -183646,11 +183636,11 @@ void __cdecl CreateCommandTerminal(_LGadRoot *root, Rect *bounds, unsigned int f { _LGadTextBoxDesc tdesc; // [esp+0h] [ebp-20h] BYREF - if ( (CmdTerm_0.statebits & 2) != 0 ) + if ( (CmdTerm.statebits & 2) != 0 ) j__DestroyCommandTerminal(); - memset(&CmdTerm_0, 0, sizeof(CmdTerm_0)); + memset(&CmdTerm, 0, sizeof(CmdTerm)); LGadSetupSubRoot( - &CmdTerm_0.root, + &CmdTerm.root, root, bounds->ul.x, bounds->ul.y, @@ -183659,25 +183649,25 @@ void __cdecl CreateCommandTerminal(_LGadRoot *root, Rect *bounds, unsigned int f memset(&tdesc, 0, sizeof(tdesc)); tdesc.bounds.lr = j__MakePointInline(bounds->lr.x - bounds->ul.x, bounds->lr.y - bounds->ul.y); tdesc.bounds.ul = j__MakePointInline(0, 0); - tdesc.editbuf = CmdTerm_0.cmdbuf; + tdesc.editbuf = CmdTerm.cmdbuf; tdesc.editbuflen = 256; - CmdTerm_0.cmdbuf[0] = 0; + CmdTerm.cmdbuf[0] = 0; tdesc.flags = 6; - tdesc.cb = j__cmdterm_textbox_cb; - LGadCreateTextBoxDesc(&CmdTerm_0.textbox, &CmdTerm_0.root, &tdesc); - CmdTerm_0.textbox.gadg.speckeys = speckeys_0; - CmdTerm_0.textbox.gadg.butt.box.box_flags |= 4u; - CmdTerm_0.statebits = 2; - CmdTerm_0.flags = flags; + tdesc.cb = (unsigned __int8 (__cdecl *)(_LGadTextBox *, int, int, void *))j__cmdterm_textbox_cb; + LGadCreateTextBoxDesc(&CmdTerm.textbox, &CmdTerm.root, &tdesc); + CmdTerm.textbox.gadg.speckeys = speckeys_0; + CmdTerm.textbox.gadg.butt.box.box_flags |= 4u; + CmdTerm.statebits = 2; + CmdTerm.flags = flags; if ( (flags & 2) != 0 ) { j__cmdterm_focus(byte_B57F04); } else if ( (flags & 1) != 0 ) { - region_set_invisible(&CmdTerm_0.root.box.r, 1u); + region_set_invisible(&CmdTerm.root.box.r, 1u); } - LGadDrawBox(&CmdTerm_0.root.box, 0); + LGadDrawBox(&CmdTerm.root.box, 0); j__cmdterm_setup_cmds(); } // 4251D0: using guessed type int j__DestroyCommandTerminal(void); @@ -183687,11 +183677,11 @@ int DestroyCommandTerminal() { unsigned int statebits; // eax - statebits = CmdTerm_0.statebits; - LOBYTE(statebits) = CmdTerm_0.statebits & 0xFD; - CmdTerm_0.statebits = statebits; - LGadDestroyTextBox(&CmdTerm_0.textbox); - return LGadDestroyRoot(&CmdTerm_0.root); + statebits = CmdTerm.statebits; + LOBYTE(statebits) = CmdTerm.statebits & 0xFD; + CmdTerm.statebits = statebits; + LGadDestroyTextBox(&CmdTerm.textbox); + return LGadDestroyRoot(&CmdTerm.root); } //----- (0044B52A) -------------------------------------------------------- @@ -183700,25 +183690,25 @@ void __cdecl cmdterm_focus(char *prefix) unsigned int context; // [esp+8h] [ebp-8h] BYREF char *buf; // [esp+Ch] [ebp-4h] - buf = CmdTerm_0.cmdbuf; - if ( (CmdTerm_0.statebits & 2) != 0 ) + buf = CmdTerm.cmdbuf; + if ( (CmdTerm.statebits & 2) != 0 ) { if ( prefix ) strncpy(buf, prefix, 0x100u); else strcpy(buf, byte_B57F08); buf[255] = 0; - region_set_invisible(&CmdTerm_0.root.box.r, 0); - CmdTerm_0.textbox.gadg.cursor = move_cursor_into_command_0(buf, 256); - TextGadgUpdate(&CmdTerm_0.textbox.gadg); - TextGadgFocus(&CmdTerm_0.textbox.gadg); - CmdTerm_0.textbox.gadg.edit &= ~4u; - LGadDrawBox(&CmdTerm_0.textbox.gadg.butt.box, 0); + region_set_invisible(&CmdTerm.root.box.r, 0); + CmdTerm.textbox.gadg.cursor = move_cursor_into_command_0(buf, 256); + TextGadgUpdate(&CmdTerm.textbox.gadg); + TextGadgFocus(&CmdTerm.textbox.gadg); + CmdTerm.textbox.gadg.edit &= ~4u; + LGadDrawBox(&CmdTerm.textbox.gadg.butt.box, 0); j__SimStatePause(); g_pInputBinder->GetContext(g_pInputBinder, &context); if ( context == 1 ) g_pInputBinder->SetContext(g_pInputBinder, 16u, 1); - CmdTerm_0.statebits |= 1u; + CmdTerm.statebits |= 1u; } } @@ -183786,13 +183776,13 @@ void __cdecl set_config_cmd(char *arg) //----- (0044BB7F) -------------------------------------------------------- void __cdecl get_config_cmd(char *arg) { - char outbuf[90]; // [esp+0h] [ebp-ECh] BYREF + char outbuf[92]; // [esp+0h] [ebp-ECh] BYREF char var[64]; // [esp+5Ch] [ebp-90h] BYREF char buf[80]; // [esp+9Ch] [ebp-50h] BYREF sscanf(arg, "%s ", var); mprintf("getting '%s'\n", var); - if ( config_get_raw(var, buf, 80) ) + if ( config_get_raw(var, buf, 0x50u) ) { sprintf(outbuf, "Value: %s", buf); j__Status(outbuf); @@ -183820,7 +183810,7 @@ void __cdecl eval_config_cmd(char *arg) if ( !(__mb_cur_max <= 1 ? _pctype[*val] & 8 : _isctype(*val, 8)) ) break; } - config_get_raw(var, valbuf, 80); + config_get_raw(var, valbuf, 0x50u); sprintf(cmdbuf, val, valbuf); if ( j__CommandExecute(cmdbuf) ) j__Status(aNoSuchCommand); @@ -183954,8 +183944,8 @@ int __cdecl find_file_in_config_path(char *targ, char *filename, char *path_var) pathbuf[0] = byte_B57FF8; memset(&pathbuf[1], 0, 255); - memset(&path, 0, sizeof(path)); - config_get_raw(path_var, pathbuf, 256); + memset((void *)&path, 0, sizeof(path)); + config_get_raw(path_var, pathbuf, 0x100u); DatapathAdd(&path, pathbuf); result = DatapathFind(&path, filename, targ, 0x50u); DatapathFree(&path); @@ -183995,7 +183985,7 @@ void __cdecl CommandRegister(Command *cmd_set, int count, unsigned int contexts) } //----- (0044C3DE) -------------------------------------------------------- -Command *__cdecl CommandFind(char *s, int n) +Command *__cdecl CommandFind(char *s, size_t n) { int j; // [esp+0h] [ebp-10h] int i; // [esp+4h] [ebp-Ch] @@ -184018,7 +184008,7 @@ Command *__cdecl CommandFind(char *s, int n) //----- (0044C48E) -------------------------------------------------------- Command *__cdecl CommandFindString(char *s) { - int v1; // eax + size_t v1; // eax v1 = strlen(s); return j__CommandFind(s, v1); @@ -184112,18 +184102,18 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) char *v9; // eax float v10; // [esp+8h] [ebp-98h] float v11; // [esp+Ch] [ebp-94h] - _DWORD *v13; // [esp+18h] [ebp-88h] + int *v13; // [esp+18h] [ebp-88h] char str[80]; // [esp+1Ch] [ebp-84h] BYREF unsigned __int8 *v15; // [esp+6Ch] [ebp-34h] float *v16; // [esp+70h] [ebp-30h] - _DWORD *v17; // [esp+78h] [ebp-28h] + int *v17; // [esp+78h] [ebp-28h] unsigned __int8 *var; // [esp+7Ch] [ebp-24h] char *tmp; // [esp+80h] [ebp-20h] void (__cdecl *v20)(char *); // [esp+84h] [ebp-1Ch] - void *v21; // [esp+88h] [ebp-18h] - void (__cdecl *v22)(_DWORD); // [esp+8Ch] [ebp-14h] + void (__cdecl *v21)(long double); // [esp+88h] [ebp-18h] + void (__cdecl *v22)(float); // [esp+8Ch] [ebp-14h] void (__cdecl *v23)(int); // [esp+90h] [ebp-10h] - void (__cdecl *val)(int); // [esp+94h] [ebp-Ch] + void (__cdecl *val)(unsigned __int8); // [esp+94h] [ebp-Ch] int do_prompt; // [esp+9Ch] [ebp-4h] if ( (*command_context_ptr & cmd->contexts) != 0 ) @@ -184144,7 +184134,7 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) ((void (*)(void))cmd->val)(); break; case 1: - val = (void (__cdecl *)(int))cmd->val; + val = (void (__cdecl *)(unsigned __int8))cmd->val; if ( do_prompt ) { v3 = j__prompt_bool(s); @@ -184157,7 +184147,7 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) } else { - val(1); + val(1u); } break; case 2: @@ -184178,24 +184168,24 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) } break; case 3: - v22 = (void (__cdecl *)(_DWORD))cmd->val; + v22 = (void (__cdecl *)(float))cmd->val; if ( do_prompt ) { v11 = j__prompt_double(s); - v22(LODWORD(v11)); + ((void (__cdecl *)(_DWORD))v22)(LODWORD(v11)); } else if ( s && *s ) { v10 = atof(s); - v22(LODWORD(v10)); + ((void (__cdecl *)(_DWORD))v22)(LODWORD(v10)); } else { - v22(0); + ((void (__cdecl *)(_DWORD))v22)(0); } break; case 4: - v21 = cmd->val; + v21 = (void (__cdecl *)(long double))cmd->val; if ( do_prompt ) { *(double *)&v7 = j__prompt_double(s); @@ -184233,7 +184223,7 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) mprintf("%s=%d\n", cmd->name, *var); break; case 7: - v17 = cmd->val; + v17 = (int *)cmd->val; if ( *s ) *v17 = atoi(s); else @@ -184267,7 +184257,7 @@ void __cdecl CommandExecuteParsed(Command *cmd, char *s) } break; case 0xC: - v13 = cmd->val; + v13 = (int *)cmd->val; if ( *s ) *v13 = atoi(s); else @@ -184290,7 +184280,7 @@ void __cdecl help_commands(char *s) int m; // [esp+0h] [ebp-44h] int ii; // [esp+4h] [ebp-40h] char cnt; // [esp+8h] [ebp-3Ch] - char holding_pen[21]; // [esp+Ch] [ebp-38h] BYREF + char holding_pen[24]; // [esp+Ch] [ebp-38h] BYREF Command *cmd; // [esp+24h] [ebp-20h] int n; // [esp+28h] [ebp-1Ch] int k; // [esp+2Ch] [ebp-18h] @@ -184532,7 +184522,7 @@ void __cdecl CoronaRender() r3d_glob.cur_stride = 60; r3_start_block(); r3_set_clip_flags(63); - r3_set_polygon_context(131328); + r3_set_polygon_context(0x20100u); lgd3d_set_blend(1); iZWrite = lgd3d_is_zwrite_on(); lgd3d_set_zwrite(0); @@ -185129,7 +185119,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -185143,7 +185133,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 44E630: using guessed type char var_8[4]; //----- (0044E6E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -185173,7 +185162,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore //----- (0044E790) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -185188,7 +185177,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore } else { - setval.value = *(void **)((int (__stdcall *)(cCoronaOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cCoronaOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -185196,7 +185185,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 44E790: using guessed type char var_C[4]; //----- (0044E870) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -185207,7 +185195,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -185216,7 +185204,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cCoronaOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cCoronaOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -185231,7 +185219,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 44E900: variable 'v5' is possibly undefined -// 44E870: using guessed type char var_C[4]; //----- (0044E940) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -185312,7 +185299,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -185324,7 +185311,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 44EB60: using guessed type char var_C[4]; //----- (0044EBF0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -185348,7 +185334,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (0044EC50) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -185358,7 +185344,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cCoronaOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 44EC50: using guessed type char var_8[4]; //----- (0044ECE0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -185592,7 +185577,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -185620,7 +185605,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 44F2FC: variable 'v4' is possibly undefined -// 44F260: using guessed type char var_10[4]; //----- (0044F360) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -186513,7 +186497,7 @@ void __thiscall cTagSet::Append(cTagSet *this, cTagSet *Source) int __thiscall cTagSet::Remove(cTagSet *this, const cTag *Tag) { cTag *pTag; // [esp+4h] [ebp-Ch] - int i; // [esp+8h] [ebp-8h] + signed int i; // [esp+8h] [ebp-8h] int iSize; // [esp+Ch] [ebp-4h] iSize = cDABase>::Size(&this->m_Data); @@ -186677,7 +186661,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -186992,7 +186976,7 @@ BOOL __cdecl find_for_load(char *fullname, char *filename) } //----- (00451D69) -------------------------------------------------------- -void __cdecl dbCurrentFile(char *buf, int len) +void __cdecl dbCurrentFile(char *buf, size_t len) { strncpy(buf, gCurrFilename, len); } @@ -187092,7 +187076,7 @@ void __cdecl munge_path(char *fullname, char *filename) strcpy(base, "."); memset(&base[2], 0, 254); j__attachPostfix(name, filename, post); - config_get_raw(aSaveDir_0, base, 256); + config_get_raw(aSaveDir_0, base, 0x100u); if ( j__is_full_path(name) ) strcpy(fullname, name); else @@ -187295,7 +187279,7 @@ unsigned int __cdecl dbMergeLoadTagFile(ITagFile *file, unsigned int loadtype) const char *v2; // eax BOOL v4; // [esp+4h] [ebp-430h] int found; // [esp+8h] [ebp-42Ch] - int success; // [esp+Ch] [ebp-428h] + BOOL success; // [esp+Ch] [ebp-428h] char fullpiecename[256]; // [esp+10h] [ebp-424h] BYREF DispatchData msg; // [esp+110h] [ebp-324h] BYREF char msgbuf[256]; // [esp+118h] [ebp-31Ch] BYREF @@ -187396,9 +187380,9 @@ void __cdecl set_gamesys_file(char *fn) } //----- (004528EB) -------------------------------------------------------- -int __cdecl read_file_type(ITagFile *file, unsigned int *Filetype) +BOOL __cdecl read_file_type(ITagFile *file, unsigned int *Filetype) { - int retval; // [esp+0h] [ebp-Ch] + BOOL retval; // [esp+0h] [ebp-Ch] VersionNum v; // [esp+4h] [ebp-8h] BYREF v = dbTypeVersion; @@ -187410,9 +187394,9 @@ int __cdecl read_file_type(ITagFile *file, unsigned int *Filetype) } //----- (0045294F) -------------------------------------------------------- -int __cdecl read_file_ref_tag(ITagFile *file, unsigned int ftype, char *filename) +BOOL __cdecl read_file_ref_tag(ITagFile *file, unsigned int ftype, char *filename) { - int success; // [esp+0h] [ebp-110h] + BOOL success; // [esp+0h] [ebp-110h] const _TagFileTag *tag; // [esp+4h] [ebp-10Ch] VersionNum v; // [esp+8h] [ebp-108h] BYREF char buf[256]; // [esp+10h] [ebp-100h] BYREF @@ -187701,7 +187685,7 @@ int secret_load_start_sounds() loop_parm.group = 0; loop_parm.gain = 100; memset(&loop_parm.delay, 0, 40); - if ( !config_get_raw(aLoadSnds_0, snd_name, 128) ) + if ( !config_get_raw(aLoadSnds_0, snd_name, 0x80u) ) strcpy(snd_name, aLoadSnd); if ( !snd_name[0] ) strcpy(snd_name, aLoadSnd_0); @@ -187764,7 +187748,8 @@ void new_world() char fname[256]; // [esp+100h] [ebp-150h] BYREF char buf[80]; // [esp+200h] [ebp-50h] BYREF - if ( config_get_raw(aDefaultGamesys, buf, 80) && (j__attachPostfix(fname, buf, aGam_2), find_for_load(fpath, fname)) ) + if ( config_get_raw(aDefaultGamesys, buf, 0x50u) + && (j__attachPostfix(fname, buf, aGam_2), find_for_load(fpath, fname)) ) { j__dbLoad(fpath, 0x40200u); set_gamesys_file(fpath); @@ -187891,11 +187876,11 @@ int __cdecl CheckForDiskspaceAndMessage(char *str, int minMB) return 1; if ( space >= minMB << 20 ) return 1; - if ( !config_get_raw(aLanguage_5, lang, 32) ) + if ( !config_get_raw(aLanguage_5, lang, 0x20u) ) strcpy(lang, aEnglish_2); strcpy(cfgvar, aNoDiskspace); strcat(cfgvar, lang); - if ( !config_get_raw(cfgvar, tmp_buf, 512) ) + if ( !config_get_raw(cfgvar, tmp_buf, 0x200u) ) strcpy(tmp_buf, aYouHaveDmOfFre); sprintf(buffer, tmp_buf, space >> 20, minMB); MessageBoxA(0, buffer, Caption, 0x10u); @@ -187982,7 +187967,7 @@ unsigned int DispatchShutdown() } //----- (00454012) -------------------------------------------------------- -void __cdecl DispatchMsg(int kind, DispatchData *data) +void __cdecl DispatchMsg(unsigned int kind, DispatchData *data) { unsigned int SaveKind; // [esp+0h] [ebp-10h] DispatchData *SaveData; // [esp+4h] [ebp-Ch] @@ -188014,7 +187999,7 @@ void __cdecl DispatchMsg(int kind, DispatchData *data) } //----- (004540C3) -------------------------------------------------------- -void __cdecl DispatchMsgAllClients(int kind, DispatchData *data, int flags) +void __cdecl DispatchMsgAllClients(unsigned int kind, DispatchData *data, int flags) { ILoopManager *Aggregated; // eax ILoopMode *v4; // eax @@ -188399,7 +188384,7 @@ unsigned int __stdcall cBaseDamageModel::HandleImpact( msgdata.data.slay = (int)impact; sDamageMsg::sDamageMsg(&msg, 2u, &msgdata, cause); result = cBaseDamageModel::SendMessage(this, &msg); - return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); } //----- (00454B2B) -------------------------------------------------------- @@ -188425,7 +188410,7 @@ unsigned int __stdcall cBaseDamageModel::DamageObject( opinion = cBaseDamageModel::SendMessage(this, &msg); if ( opinion > result ) result = opinion; - return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); } //----- (00454BB4) -------------------------------------------------------- @@ -188435,7 +188420,7 @@ unsigned int __stdcall cBaseDamageModel::SlayObject( int culprit, sChainedEvent *cause) { - const sChainedEvent *v5; // [esp+0h] [ebp-38h] + sDamageMsg *v5; // [esp+0h] [ebp-38h] int kind; // [esp+4h] [ebp-34h] sDamageMsg msg; // [esp+8h] [ebp-30h] BYREF sDamageMsgData msgdata; // [esp+24h] [ebp-14h] BYREF @@ -188444,9 +188429,9 @@ unsigned int __stdcall cBaseDamageModel::SlayObject( kind = 0; if ( cause ) { - v5 = sChainedEvent::Find(cause, 3u); + v5 = (sDamageMsg *)sChainedEvent::Find(cause, 3u); if ( v5 ) - kind = *(_DWORD *)(v5[2].ev.kind + 4); + kind = *(_DWORD *)(v5->data.slay + 4); } msgdata.kind = 4; msgdata.victim = victim; @@ -188457,7 +188442,7 @@ unsigned int __stdcall cBaseDamageModel::SlayObject( if ( result <= 4 ) return 4; else - return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); } //----- (00454C53) -------------------------------------------------------- @@ -188476,7 +188461,7 @@ unsigned int __stdcall cBaseDamageModel::TerminateObject(cBaseDamageModel *this, if ( result <= 5 ) return 5; else - return cBaseDamageModel::ApplyResult(this, victim, 0, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, 0, result, &msg.sChainedEvent); } //----- (00454CC6) -------------------------------------------------------- @@ -188503,7 +188488,7 @@ unsigned int __stdcall cBaseDamageModel::ResurrectObject( if ( result <= 6 ) return 6; else - return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); } //----- (00454D4E) -------------------------------------------------------- @@ -188753,7 +188738,7 @@ void __thiscall sDamageMsg::sDamageMsg(sDamageMsg *this, unsigned int k, const s char v6; // [esp+8h] [ebp-14h] BYREF const sDamageMsgData *v7; // [esp+18h] [ebp-4h] - sChainedEvent::sChainedEvent(this, k, 0x1Cu, ev); + sChainedEvent::sChainedEvent(&this->sChainedEvent, k, 0x1Cu, ev); if ( dat ) v4 = dat; else @@ -189175,7 +189160,7 @@ eSlayResult __cdecl ObjGetSlayResult(int obj) } //----- (00456159) -------------------------------------------------------- -void __cdecl ObjSetSlayResult(int obj, int result) +void __cdecl ObjSetSlayResult(int obj, eSlayResult result) { if ( !SlayResultProp ) _CriticalMsg(aSlayresultprop_0, aRPrjThief2Skup_2666, 0x7Au); @@ -189397,7 +189382,7 @@ int __cdecl GetErrorMessage(char *msgbuffer, const char *basename, int buflen) numstrings = 0; successful = 1; strncpy(shortbase, basename, 0x20u); - if ( !config_get_raw(aLanguage_4, lang, 28) ) + if ( !config_get_raw(aLanguage_4, lang, 0x1Cu) ) strcpy(lang, aEnglish_1); sprintf(cfgvar, "%snum_%s", shortbase, lang); if ( !config_get_single_value(cfgvar, 1, (void **)&numstrings) ) @@ -189406,7 +189391,7 @@ int __cdecl GetErrorMessage(char *msgbuffer, const char *basename, int buflen) for ( i = 1; i <= numstrings; ++i ) { sprintf(cfgvar, "%s%d_%s", shortbase, i, lang); - if ( config_get_raw(cfgvar, configline, 80) ) + if ( config_get_raw(cfgvar, configline, 0x50u) ) { if ( i > 1 && buflen > 0 ) { @@ -189571,7 +189556,7 @@ void __cdecl CellRefListClearFunc(_DWORD *bin) } //----- (0045706A) -------------------------------------------------------- -void __cdecl CellBinUpdateFunc(int obj, int refsys, _DWORD *binmem, int num_bins) +void __cdecl CellBinUpdateFunc(int obj, unsigned int refsys, _DWORD *binmem, int num_bins) { unsigned int firstref; // [esp+0h] [ebp-41Ch] int j; // [esp+8h] [ebp-414h] @@ -190487,7 +190472,7 @@ const sPropertyStoreDesc *__stdcall cHashPropertyStore::Describe(cHashProp //----- (00458840) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Create(cHashPropertyStore *this, sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -190501,7 +190486,6 @@ sDatum *__stdcall cHashPropertyStore::Create(cHashPropertyStore *thi result->value = val.value; return result; } -// 458840: using guessed type char var_8[4]; //----- (004588F0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -190531,7 +190515,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore *this, int //----- (004589A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -190546,12 +190530,14 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int } else { - setval.value = *(void **)((int (__stdcall *)(cOps *, char *, void *))this->mOps.CopyNew)(&this->mOps, v4, val.value); + setval.value = *(void **)((int (__stdcall *)(cOps *, _BYTE *, void *))this->mOps.CopyNew)( + &this->mOps, + v4, + val.value); } cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4589A0: using guessed type char var_C[4]; //----- (00458A80) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -190562,7 +190548,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -190571,7 +190557,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -190586,7 +190572,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 458B10: variable 'v5' is possibly undefined -// 458A80: using guessed type char var_C[4]; //----- (00458B50) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -190661,7 +190646,7 @@ int __stdcall cPropertyStore::WriteObj(cPropertyStore *this, int obj //----- (00458D70) -------------------------------------------------------- int __stdcall cPropertyStore::ReadObj(cPropertyStore *this, int obj, IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -190673,7 +190658,6 @@ int __stdcall cPropertyStore::ReadObj(cPropertyStore *this, int obj, ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 458D70: using guessed type char var_C[4]; //----- (00458E00) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -190697,7 +190681,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, IDataOps //----- (00458E60) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -190707,7 +190691,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, ((void (__stdcall *)(cOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 458E60: using guessed type char var_8[4]; //----- (00458EF0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -190928,7 +190911,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -190956,7 +190939,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 45947C: variable 'v4' is possibly undefined -// 4593E0: using guessed type char var_10[4]; //----- (004594E0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -192126,7 +192108,7 @@ void __thiscall cDABase>::~cDABasem_pItems ) { cDARawSrvFns::PreSetSize(this->m_pItems, this->m_nItems, 0); - cDABaseSrvFns::DoResize((void **)&this->m_pItems, 8u, 0); + cDABaseSrvFns::DoResize((void **)this, 8u, 0); } } @@ -192162,7 +192144,7 @@ int __thiscall cDABase>::SetSize( //----- (0045BA80) -------------------------------------------------------- void __thiscall cDABase>::cDABase>( cDABase > *this, - int size) + unsigned int size) { this->m_pItems = 0; this->m_nItems = 0; @@ -192310,7 +192292,7 @@ int __thiscall cDABase>::Resize( if ( ((this->m_nItems + 3) & 0xFFFFFFFC) == evenSlots ) return 1; else - return cDABaseSrvFns::DoResize((void **)&this->m_pItems, 8u, evenSlots); + return cDABaseSrvFns::DoResize((void **)this, 8u, evenSlots); } //----- (0045BED0) -------------------------------------------------------- @@ -192334,7 +192316,7 @@ unsigned int __cdecl cHashTableFunctions::Hash(const int *k) } //----- (0045BF50) -------------------------------------------------------- -unsigned int __cdecl cHashFunctions::Hash(unsigned int p) +unsigned int __cdecl cHashFunctions::Hash(int p) { return HashPtr(p); } @@ -192858,7 +192840,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -192868,7 +192850,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 45CB70: using guessed type char var_10[4]; //----- (0045CC10) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -192963,7 +192944,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -192976,13 +192957,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cESndTagOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 45CE60: using guessed type char var_10[4]; //----- (0045CF10) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -192994,7 +192974,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -193014,7 +192994,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cESndTagOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cESndTagOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -193030,7 +193010,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 45CF10: using guessed type char var_18[4]; //----- (0045D020) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -193123,7 +193102,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -193135,7 +193114,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 45D200: using guessed type char var_C[4]; //----- (0045D290) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -193159,7 +193137,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (0045D2F0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -193169,7 +193147,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cESndTagOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 45D2F0: using guessed type char var_8[4]; //----- (0045D380) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -193331,7 +193308,7 @@ int __stdcall cESndTagOps::Read(cESndTagOps *this, sDatum *dat, IDataOpsFile *fi int v4; // eax int v6; // [esp+0h] [ebp-210h] sOpsList v7; // [esp+4h] [ebp-20Ch] BYREF - char v8[4]; // [esp+104h] [ebp-10Ch] BYREF + _BYTE v8[4]; // [esp+104h] [ebp-10Ch] BYREF int sz; // [esp+108h] [ebp-108h] sOpsList *list; // [esp+10Ch] [ebp-104h] sESndTagList tmp; // [esp+110h] [ebp-100h] BYREF @@ -193353,7 +193330,6 @@ int __stdcall cESndTagOps::Read(cESndTagOps *this, sDatum *dat, IDataOpsFile *fi sOpsList::~sOpsList(&v7); return 0; } -// 45D730: using guessed type char var_10C[4]; //----- (0045D860) -------------------------------------------------------- void __thiscall sOpsList::sOpsList(sOpsList *this, const sESndTagList *dat) @@ -193573,7 +193549,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -193601,7 +193577,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 45DE02: variable 'v4' is possibly undefined -// 45DD60: using guessed type char var_10[4]; //----- (0045DE60) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -193860,7 +193835,7 @@ void __cdecl BuildFacePosFile() IObjectQuery *pObjQuery; // [esp+14h] [ebp-104h] char aszPath[256]; // [esp+18h] [ebp-100h] BYREF - if ( config_get_raw(aFacePath, aszPath, 256) ) + if ( config_get_raw(aFacePath, aszPath, 0x100u) ) { strcat(aszPath, aFaceposStr); mprintf("face: Using path: %s.\n", aszPath); @@ -194100,7 +194075,7 @@ double __cdecl StandardDeviation(float *pfSamples, unsigned int nCount, float fA } //----- (0045EC62) -------------------------------------------------------- -char __cdecl FindFacePos(float *pfSamples, int iNum, float fStDev) +char __cdecl FindFacePos(float *pfSamples, unsigned int iNum, float fStDev) { float fAverage; // [esp+0h] [ebp-Ch] char iRV; // [esp+4h] [ebp-8h] @@ -195280,7 +195255,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -195294,7 +195269,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 460DD0: using guessed type char var_8[4]; //----- (00460E80) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -195324,7 +195298,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore *th //----- (00460F30) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -195339,7 +195313,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore *th } else { - setval.value = *(void **)((int (__stdcall *)(cFaceOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cFaceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -195347,7 +195321,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore *th cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 460F30: using guessed type char var_C[4]; //----- (00461010) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -195358,7 +195331,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -195367,7 +195340,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cFaceOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cFaceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -195382,7 +195355,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4610A0: variable 'v5' is possibly undefined -// 461010: using guessed type char var_C[4]; //----- (004610E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -195461,7 +195433,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -195473,7 +195445,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 461300: using guessed type char var_C[4]; //----- (00461390) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -195497,7 +195468,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, I //----- (004613F0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -195507,7 +195478,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, ((void (__stdcall *)(cFaceOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4613F0: using guessed type char var_8[4]; //----- (00461480) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -195593,7 +195563,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -195607,7 +195577,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 461620: using guessed type char var_8[4]; //----- (004616D0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -195637,7 +195606,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -195652,7 +195621,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cFaceStateOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -195660,7 +195629,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 461780: using guessed type char var_C[4]; //----- (00461860) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -195671,7 +195639,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -195680,7 +195648,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cFaceStateOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cFaceStateOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -195695,7 +195663,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4618F0: variable 'v5' is possibly undefined -// 461860: using guessed type char var_C[4]; //----- (00461930) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -195778,7 +195745,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -195790,7 +195757,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 461B50: using guessed type char var_C[4]; //----- (00461BE0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -195814,7 +195780,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -195824,7 +195790,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 461C40: using guessed type char var_8[4]; //----- (00461CD0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -196115,7 +196080,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -196143,7 +196108,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4624B2: variable 'v4' is possibly undefined -// 462410: using guessed type char var_10[4]; //----- (00462510) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -196250,7 +196214,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -196278,7 +196242,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4627EC: variable 'v4' is possibly undefined -// 462750: using guessed type char var_10[4]; //----- (00462850) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -196791,12 +196754,12 @@ int __cdecl family_add(char *str) // 41BF09: using guessed type int j__texmemRebuildDefaultMaps(void); //----- (004635CA) -------------------------------------------------------- -int __cdecl fam_palette_check(char *dir) +BOOL __cdecl fam_palette_check(char *dir) { const void *v2; // eax unsigned __int8 *pal; // [esp-8h] [ebp-14h] IRes *loc_hnd; // [esp+0h] [ebp-Ch] - int rv; // [esp+4h] [ebp-8h] + BOOL rv; // [esp+4h] [ebp-8h] IResMan *pResMan; // [esp+8h] [ebp-4h] if ( config_get_raw(aTerrtextures16, 0, 0) ) @@ -196976,10 +196939,10 @@ int __cdecl family_texture_is_water(int i) } //----- (00463C15) -------------------------------------------------------- -int __cdecl family_find_water(const char *prefix, int *handles) +BOOL __cdecl family_find_water(const char *prefix, int *handles) { char *base; // [esp+8h] [ebp-114h] - int rv; // [esp+10h] [ebp-10Ch] + BOOL rv; // [esp+10h] [ebp-10Ch] int hnd[2]; // [esp+14h] [ebp-108h] BYREF char buf[256]; // [esp+1Ch] [ebp-100h] BYREF @@ -197462,12 +197425,12 @@ void __cdecl FrameAnimationStateStart(FrameAnimationState *fas) void __cdecl FrameAnimationStateBackdateSetFrame( FrameAnimationState *fas, FrameAnimationConfig *cfg, - int frame, + unsigned int frame, unsigned int tm) { unsigned int v4; // [esp+0h] [ebp-Ch] - fas->start_time = (__int64)((double)tm - (double)frame * cfg->fps * 1000.0); + fas->start_time = (__int64)((double)tm - (double)(int)frame * cfg->fps * 1000.0); if ( fas->start_time > tm ) fas->start_time = 0; if ( cfg->fps == 0.0 ) @@ -197500,7 +197463,7 @@ void __cdecl FrameAnimationChange( FrameAnimationConfig *old_cfg, int old_frames, FrameAnimationConfig *new_cfg, - int new_frames) + unsigned int new_frames) { float frame_left; // [esp+14h] [ebp-Ch] unsigned __int8 prev_bounce; // [esp+18h] [ebp-8h] @@ -197513,7 +197476,7 @@ void __cdecl FrameAnimationChange( old_cfg->bounce = 0; j__FrameAnimationGetFrame(state, old_cfg, old_frames); old_cfg->bounce = prev_bounce; - if ( new_cfg->bounce && new_frames > 1 ) + if ( new_cfg->bounce && (int)new_frames > 1 ) new_frames = 2 * new_frames - 2; if ( state->cur_frame >= new_frames ) state->cur_frame = new_frames - 1; @@ -198433,7 +198396,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -198455,7 +198418,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 466700: using guessed type char var_18[4]; //----- (004667C0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -198512,7 +198474,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -198532,7 +198494,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cFAStateOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cFAStateOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -198543,7 +198505,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 4668E0: using guessed type char var_1C[4]; //----- (004669D0) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -198557,7 +198518,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -198566,7 +198527,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cFAStateOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cFAStateOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -198585,7 +198546,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 466A6A: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 4669D0: using guessed type char var_14[4]; //----- (00466AB0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -198676,7 +198636,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -198688,7 +198648,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 466D20: using guessed type char var_C[4]; //----- (00466DB0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -198712,7 +198671,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (00466E10) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -198722,7 +198681,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cFAStateOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 466E10: using guessed type char var_8[4]; //----- (00466EA0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -198812,7 +198770,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -198834,7 +198792,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 467040: using guessed type char var_18[4]; //----- (00467100) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -198891,7 +198848,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -198911,7 +198868,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cFAConfigOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cFAConfigOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -198922,7 +198879,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 467220: using guessed type char var_1C[4]; //----- (00467310) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -198936,7 +198892,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -198945,7 +198901,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cFAConfigOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cFAConfigOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -198964,7 +198920,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 4673AA: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 467310: using guessed type char var_14[4]; //----- (004673F0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -199055,7 +199010,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -199067,7 +199022,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 467660: using guessed type char var_C[4]; //----- (004676F0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -199091,7 +199045,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore //----- (00467750) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -199101,7 +199055,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore ((void (__stdcall *)(cFAConfigOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 467750: using guessed type char var_8[4]; //----- (004677E0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -199594,7 +199547,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -199622,7 +199575,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 46846C: variable 'v4' is possibly undefined -// 4683D0: using guessed type char var_10[4]; //----- (004684D0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -199791,7 +199743,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -199819,7 +199771,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4688AC: variable 'v4' is possibly undefined -// 468810: using guessed type char var_10[4]; //----- (00468910) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -199984,7 +199935,7 @@ void __thiscall cFancyTagDatabase::InsertData( cFancyTagDatabase *this, int category, ITagDBKeySet *pSet, - sTagDBData Data) + const sTagDBData Data) { float fWeight; // [esp+4h] [ebp-1Ch] unsigned int i; // [esp+8h] [ebp-18h] BYREF @@ -200417,7 +200368,7 @@ bool __cdecl dir_exists(char *path) endslash = path[strlen(path) - 1]; if ( endslash == 92 || endslash == 47 ) path[strlen(path) - 1] = 0; - strv = stat_0(path, (struct _stat32 *const)&st); + strv = stat(path, (struct _stat32 *const)&st); if ( endslash == 92 || endslash == 47 ) path[strlen(path) - 1] = endslash; return strv != -1; @@ -200527,7 +200478,12 @@ BOOL __cdecl is_full_path(const char *fn) } //----- (00469EE0) -------------------------------------------------------- -char *__cdecl FileDialog(eFileMenuMode mode, sFileMenuFilter *pFilters, const char *def_ext, char *buffer, int buflen) +char *__cdecl FileDialog( + eFileMenuMode mode, + sFileMenuFilter *pFilters, + const char *def_ext, + char *buffer, + unsigned int buflen) { IWinApp *Aggregated; // eax unsigned int Flags; // ecx @@ -200611,7 +200567,7 @@ char *__cdecl FileDialog(eFileMenuMode mode, sFileMenuFilter *pFilters, const ch } //----- (0046A0E1) -------------------------------------------------------- -LRESULT __stdcall FileMenuWndProc(HWND__ *hWnd, unsigned int msg, unsigned int wParam, int lParam) +LRESULT __stdcall FileMenuWndProc(HWND__ *hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if ( msg == 16 ) { @@ -200812,7 +200768,7 @@ int __thiscall cFileVarBase::SetupFile(cFileVarBase *this, ITagFile *file) if ( this->mDesc->game ) { - config_get_raw(aGame_9, buf, 64); + config_get_raw(aGame_9, buf, 0x40u); if ( strnicmp(buf, this->mDesc->game, 0x40u) ) return 0; } @@ -202088,7 +202044,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -202110,7 +202066,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 46CC30: using guessed type char var_18[4]; //----- (0046CCF0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -202169,7 +202124,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -202189,7 +202144,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -202200,7 +202155,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 46CE10: using guessed type char var_1C[4]; //----- (0046CF00) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -202214,7 +202168,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -202223,7 +202177,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -202242,7 +202196,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 46CF9A: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 46CF00: using guessed type char var_14[4]; //----- (0046CFE0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -202336,7 +202289,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -202348,7 +202301,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 46D250: using guessed type char var_C[4]; //----- (0046D2E0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -202372,7 +202324,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -202382,7 +202334,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 46D340: using guessed type char var_8[4]; //----- (0046D3D0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -203731,8 +203682,8 @@ ILoopClient *__stdcall CreateClient_1(sLoopClientDesc *pDesc, tLoopClientData__ //----- (0046FB32) -------------------------------------------------------- int __stdcall LoopFunc_1(_StateRecord *data, int msg, tLoopMessageData__ *hdata) { - IUnknown *v4; // [esp+38h] [ebp-44h] - IUnknown *Aggregated; // [esp+3Ch] [ebp-40h] + ISimManager *v4; // [esp+38h] [ebp-44h] + ILoop *Aggregated; // [esp+3Ch] [ebp-40h] ISimManager *pSimMan; // [esp+40h] [ebp-3Ch] ILoop *pLoop; // [esp+44h] [ebp-38h] int profile; // [esp+48h] [ebp-34h] BYREF @@ -203838,18 +203789,14 @@ int __stdcall LoopFunc_1(_StateRecord *data, int msg, tLoopMessageData__ *hdata) j__ScrnModeSetConfig(&src, aGame_8); return result; case 0x8000: - Aggregated = _AppGetAggregated(&IID_ILoop); - ((void (__thiscall *)(IUnknown *, IUnknown *, _DWORD, _DWORD))Aggregated->__vftable[7].AddRef)( - Aggregated, - Aggregated, - 0, - 0); + Aggregated = (ILoop *)_AppGetAggregated(&IID_ILoop); + ((void (__thiscall *)(ILoop *, ILoop *, _DWORD, _DWORD))Aggregated->SetProfile)(Aggregated, Aggregated, 0, 0); if ( Aggregated ) - ((void (__thiscall *)(IUnknown *, IUnknown *))Aggregated->Release)(Aggregated, Aggregated); - v4 = _AppGetAggregated(&IID_ISimManager); - ((void (__thiscall *)(IUnknown *, IUnknown *))v4->__vftable[2].AddRef)(v4, v4); + ((void (__thiscall *)(ILoop *, ILoop *))Aggregated->Release)(Aggregated, Aggregated); + v4 = (ISimManager *)_AppGetAggregated(&IID_ISimManager); + ((void (__thiscall *)(ISimManager *, ISimManager *))v4->SuspendSim)(v4, v4); if ( v4 ) - ((void (__thiscall *)(IUnknown *, IUnknown *))v4->Release)(v4, v4); + ((void (__thiscall *)(ISimManager *, ISimManager *))v4->Release)(v4, v4); j__SimStateSet((SimState *)state[1].context); shutdown_mode(); if ( histo_defined ) @@ -206161,7 +206108,7 @@ char *__cdecl CreepOnProc(char *__formal, char *val) return 0; if ( dval != 0.0 && j__GetPlayerMode() == kPM_Dead ) return 0; - gcreepon = *(_QWORD *)&dval == 0x3FF0000000000000i64; + gcreepon = *(_QWORD *)&dval == 0x3FF0000000000000LL; if ( grunon || !gcreepon ) { if ( grunon || gcreepon ) @@ -206211,7 +206158,7 @@ char *__cdecl RunOnProc(char *__formal, char *val) return 0; if ( dval != 0.0 && j__GetPlayerMode() == kPM_Dead ) return 0; - grunon = *(_QWORD *)&dval == 0x3FF0000000000000i64; + grunon = *(_QWORD *)&dval == 0x3FF0000000000000LL; if ( dval == 1.0 || !gcreepon ) { if ( grunon || gcreepon ) @@ -206284,7 +206231,7 @@ char *__cdecl RudderTurnProc(char *__formal, char *val) const char *v3; // eax double X; // st7 float v5; // [esp+10h] [ebp-18h] - int isNoise; // [esp+1Ch] [ebp-Ch] + BOOL isNoise; // [esp+1Ch] [ebp-Ch] float fval; // [esp+20h] [ebp-8h] if ( j__GetPlayerMode() == kPM_Dead ) @@ -206339,7 +206286,7 @@ void InitIBVars() g_pInputBinder->VarSet(g_pInputBinder, g_gen_ib_vars); if ( gInitGameIBVars ) gInitGameIBVars(); - config_get_raw(aGame_4, gamebnd, 128); + config_get_raw(aGame_4, gamebnd, 0x80u); for ( s = gamebnd; *s != 32 && *s; ++s ) ; *s = 0; @@ -207943,7 +207890,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -207965,7 +207912,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 477780: using guessed type char var_18[4]; //----- (00477840) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -208024,7 +207970,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -208044,7 +207990,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cWaterColorOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cWaterColorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -208055,7 +208001,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 477960: using guessed type char var_1C[4]; //----- (00477A50) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -208069,7 +208014,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -208078,7 +208023,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cWaterColorOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cWaterColorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -208097,7 +208042,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 477AEA: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 477A50: using guessed type char var_14[4]; //----- (00477B30) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -208191,7 +208135,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -208203,7 +208147,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 477DA0: using guessed type char var_C[4]; //----- (00477E30) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -208227,7 +208170,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -208237,7 +208180,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 477E90: using guessed type char var_8[4]; //----- (00477F20) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -208674,7 +208616,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -208702,7 +208644,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 47898C: variable 'v4' is possibly undefined -// 4788F0: using guessed type char var_10[4]; //----- (004789F0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -209583,7 +209524,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -209605,7 +209546,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 47A0C0: using guessed type char var_18[4]; //----- (0047A180) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -209662,7 +209602,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -209682,7 +209622,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cHeatDiskOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cHeatDiskOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -209693,7 +209633,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 47A2A0: using guessed type char var_1C[4]; //----- (0047A390) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -209707,7 +209646,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -209716,7 +209655,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cHeatDiskOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cHeatDiskOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -209735,7 +209674,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 47A42A: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 47A390: using guessed type char var_14[4]; //----- (0047A470) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -209826,7 +209764,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -209838,7 +209776,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 47A6E0: using guessed type char var_C[4]; //----- (0047A770) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -209862,7 +209799,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore //----- (0047A7D0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -209872,7 +209809,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore ((void (__stdcall *)(cHeatDiskOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 47A7D0: using guessed type char var_8[4]; //----- (0047A860) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -210174,7 +210110,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -210202,7 +210138,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 47AFEC: variable 'v4' is possibly undefined -// 47AF50: using guessed type char var_10[4]; //----- (0047B050) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -210956,7 +210891,7 @@ int __cdecl incparse() INCSTYPE *incpv; // [esp+1Ch] [ebp-13Ch] __int16 incstate; // [esp+20h] [ebp-138h] __int16 *incps; // [esp+24h] [ebp-134h] - __int16 incs[151]; // [esp+28h] [ebp-130h] BYREF + __int16 incs[152]; // [esp+28h] [ebp-130h] BYREF incnerrs = 0; incerrflag = 0; @@ -212136,16 +212071,16 @@ int __stdcall CoreEngineCreateObjects(int argc, const char **argv) v8 = _AppGetAggregated(&IID_IUnknown); _ResSharedCacheCreate(&IID_ISharedCache, 0, v8); v8->Release(v8); - if ( config_get_raw(aRecord, buffer, 38) ) + if ( config_get_raw(aRecord, buffer, 0x26u) ) { v7 = _AppGetAggregated(&IID_IUnknown); - _RecorderCreate(&IID_IRecorder, 0, v7, 0, 0, buffer, 0); + _RecorderCreate(&IID_IRecorder, 0, v7, 0, 0, buffer, kRecSaveUnconditional); v7->Release(v7); } - else if ( config_get_raw(aPlayback, buffer, 38) ) + else if ( config_get_raw(aPlayback, buffer, 0x26u) ) { v6 = _AppGetAggregated(&IID_IUnknown); - _RecorderCreate(&IID_IRecorder, 0, v6, (sHashSetChunk **)1, 0, buffer, 0); + _RecorderCreate(&IID_IRecorder, 0, v6, (sHashSetChunk **)1, 0, buffer, kRecSaveUnconditional); v6->Release(v6); } md_use_lgd3d(); @@ -212189,7 +212124,7 @@ void init_monochrome() mono_win_init(is_mono); mono_clear(); mono_set_flags(3, 0); - config_get_raw(aMonolog, monofname, 256); + config_get_raw(aMonolog, monofname, 0x100u); if ( !strcmp(monofname, byte_B5BCF8) ) strcpy(monofname, aMonologTxt); if ( config_get_raw(aMonolog_0, 0, 0) ) @@ -212206,12 +212141,12 @@ __int16 pick_game() char buf[80]; // [esp+104h] [ebp-D0h] BYREF char game[128]; // [esp+154h] [ebp-80h] BYREF - if ( config_get_raw(aGame_2, buf, 80) ) + if ( config_get_raw(aGame_2, buf, 0x50u) ) j__AppSelectGame(buf); else j__AppSelectGame(0); config_load(aProgCfg); - config_get_raw(aGame_3, game, 128); + config_get_raw(aGame_3, game, 0x80u); for ( s = &buf[strlen(game) + 79]; s >= game && isspace(*s); --s ) *s = 0; strcat(game, aCfg); @@ -212271,11 +212206,11 @@ void __cdecl AppShutdownConfig() //----- (0047FBC0) -------------------------------------------------------- unsigned __int8 __cdecl write_func(char *filename, char *var) { - char buf[2]; // [esp+0h] [ebp-4h] BYREF + char buf[4]; // [esp+0h] [ebp-4h] BYREF if ( config_write_to_same_file(filename, var) ) return 1; - config_get_origin(var, buf, 2); + config_get_origin(var, buf, 2u); if ( buf[0] ) return config_default_writable(filename, var); else @@ -212557,7 +212492,7 @@ void __cdecl _E3_0() } //----- (0048062E) -------------------------------------------------------- -IStructEditor *__cdecl CreateStructEditor(sStructEditorDesc *eddesc, sStructDesc *sdesc, void *editme) +IStructEditor *__cdecl CreateStructEditor(const sStructEditorDesc *eddesc, const sStructDesc *sdesc, void *editme) { IStructEditor *(__stdcall *ProcAddress)(sStructEditorDesc *, sStructDesc *, void *); // eax @@ -212637,7 +212572,7 @@ void __thiscall cDarkJoyProcControl::cDarkJoyProcControl(cDarkJoyProcControl *th // 96BA34: using guessed type void *cDarkJoyProcControl::`vftable'; //----- (00480824) -------------------------------------------------------- -void __cdecl UiJoyAxisConfigure(int axis, int *pRange, int *pMid, int deadZone) +void __cdecl UiJoyAxisConfigure(int axis, int *pRange, int *pMid, unsigned int deadZone) { int joyMin; // [esp+0h] [ebp-8h] BYREF int joyMax; // [esp+4h] [ebp-4h] BYREF @@ -212697,7 +212632,7 @@ int UiJoyInit() } //----- (00480A86) -------------------------------------------------------- -void __cdecl DispatchJoystickMoveEvent(unsigned __int8 joyNum, __int16 x, __int16 y) +void __cdecl DispatchJoystickMoveEvent(char joyNum, __int16 x, __int16 y) { _ui_joy_event ev; // [esp+0h] [ebp-10h] BYREF @@ -212711,7 +212646,7 @@ void __cdecl DispatchJoystickMoveEvent(unsigned __int8 joyNum, __int16 x, __int1 } //----- (00480ACB) -------------------------------------------------------- -void __cdecl DispatchJoystickButtonEvent(unsigned __int8 buttNum, char state) +void __cdecl DispatchJoystickButtonEvent(char buttNum, char state) { _ui_joy_event ev; // [esp+0h] [ebp-10h] BYREF @@ -212945,15 +212880,15 @@ int __cdecl LightPropInit() ILightProperty *v4; // [esp+4h] [ebp-14h] cColorProperty *v5; // [esp+8h] [ebp-10h] cLightProperty *v6; // [esp+Ch] [ebp-Ch] - IUnknown *Aggregated; // [esp+10h] [ebp-8h] + IStructDescTools *Aggregated; // [esp+10h] [ebp-8h] IStructDescTools *tools; // [esp+14h] [ebp-4h] tools = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); tools->Register(tools, &light_struct); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)(Aggregated, &color_struct); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &color_struct); if ( Aggregated ) Aggregated->Release(Aggregated); v6 = (cLightProperty *)j__new(0xF0u, aRPrjThief2Skup_2585, 368); @@ -213159,7 +213094,7 @@ int __cdecl FindVhotLocation(mxs_vector *loc, int obj, int vhot) if ( fabs(loc->z) + v5 > 0.2 ) mprintf("lightvhot bogus loc (%d) (wrong %g %g %g)\n", obj, loc->x, loc->y, loc->z); } - *(_QWORD *)&loc->el[1] = 0i64; + *(_QWORD *)&loc->el[1] = 0LL; loc->x = 0.0; bRetVal = 0; if ( j__ObjGetModelNumber(obj, &idx) && j__objmodelGetModelType(idx) == 1 ) @@ -213400,7 +213335,7 @@ int __cdecl CalcSpotlightVec(mxs_vector *pDir, mxs_vector *pStartPoint, int obj) } else { - *(_QWORD *)&pDir->x = 0i64; + *(_QWORD *)&pDir->x = 0LL; pDir->z = -1.0; return 1; } @@ -214958,7 +214893,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -214972,7 +214907,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 484930: using guessed type char var_8[4]; //----- (004849E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -215002,7 +214936,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore * //----- (00484A90) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215017,7 +214951,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * } else { - setval.value = *(void **)((int (__stdcall *)(cLightOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cLightOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -215025,7 +214959,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 484A90: using guessed type char var_C[4]; //----- (00484B70) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -215036,7 +214969,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -215045,7 +214978,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cLightOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cLightOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -215060,7 +214993,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 484C00: variable 'v5' is possibly undefined -// 484B70: using guessed type char var_C[4]; //----- (00484C40) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -215139,7 +215071,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215151,7 +215083,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 484E60: using guessed type char var_C[4]; //----- (00484EF0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -215175,7 +215106,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, //----- (00484F50) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -215185,7 +215116,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this ((void (__stdcall *)(cLightOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 484F50: using guessed type char var_8[4]; //----- (00484FE0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -215269,7 +215199,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -215283,7 +215213,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 485180: using guessed type char var_8[4]; //----- (00485230) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -215313,7 +215242,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore * //----- (004852E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215328,7 +215257,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * } else { - setval.value = *(void **)((int (__stdcall *)(cColorOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cColorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -215336,7 +215265,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4852E0: using guessed type char var_C[4]; //----- (004853C0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -215347,7 +215275,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -215356,7 +215284,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cColorOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cColorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -215371,7 +215299,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 485450: variable 'v5' is possibly undefined -// 4853C0: using guessed type char var_C[4]; //----- (00485490) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -215450,7 +215377,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215462,7 +215389,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4856B0: using guessed type char var_C[4]; //----- (00485740) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -215486,7 +215412,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, //----- (004857A0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -215496,7 +215422,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this ((void (__stdcall *)(cColorOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4857A0: using guessed type char var_8[4]; //----- (00485830) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -215580,7 +215505,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -215594,7 +215519,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4859D0: using guessed type char var_8[4]; //----- (00485A80) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -215624,7 +215548,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore *th //----- (00485B30) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215639,7 +215563,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore *th } else { - setval.value = *(void **)((int (__stdcall *)(cAnimOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAnimOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -215647,7 +215571,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore *th cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 485B30: using guessed type char var_C[4]; //----- (00485C10) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -215658,7 +215581,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -215667,7 +215590,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAnimOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAnimOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -215682,7 +215605,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 485CA0: variable 'v5' is possibly undefined -// 485C10: using guessed type char var_C[4]; //----- (00485CE0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -215761,7 +215683,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -215773,7 +215695,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 485F00: using guessed type char var_C[4]; //----- (00485F90) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -215797,7 +215718,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, I //----- (00485FF0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -215807,7 +215728,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, ((void (__stdcall *)(cAnimOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 485FF0: using guessed type char var_8[4]; //----- (00486080) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -216157,7 +216077,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -216185,7 +216105,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4869EC: variable 'v4' is possibly undefined -// 486950: using guessed type char var_10[4]; //----- (00486A50) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -216303,7 +216222,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -216331,7 +216250,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 486D2C: variable 'v4' is possibly undefined -// 486C90: using guessed type char var_10[4]; //----- (00486D90) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -216438,7 +216356,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -216466,7 +216384,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 48706C: variable 'v4' is possibly undefined -// 486FD0: using guessed type char var_10[4]; //----- (004870D0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -216840,7 +216757,7 @@ void __cdecl ResTokenize(const char *pName, char (*tok_strs)[16], int *tok_cnt, { int tok_num; // [esp+0h] [ebp-24h] int i; // [esp+4h] [ebp-20h] - char pathElem[17]; // [esp+Ch] [ebp-18h] BYREF + char pathElem[20]; // [esp+Ch] [ebp-18h] BYREF char *p; // [esp+20h] [ebp-4h] tok_num = 0; @@ -216892,7 +216809,7 @@ void __cdecl ResDetokenize(_tok_name *tok_name, char *built_name, char (*tok_str int first; // [esp+4h] [ebp-4h] first = 1; - for ( i = 0; i < 4 && tok_name->tokens[i] && (unsigned int)tok_name->tokens[i] < 0x41; ++i ) + for ( i = 0; i < 4 && tok_name->tokens[i] && (unsigned int)tok_name->tokens[i] <= 0x40; ++i ) { if ( first ) { @@ -217142,7 +217059,7 @@ int set_loopmode_noise() char buf[12]; // [esp+8h] [ebp-10h] BYREF unsigned int messes; // [esp+14h] [ebp-4h] BYREF - result = config_get_raw(aDispatchNoise, buf, 12); + result = config_get_raw(aDispatchNoise, buf, 0xCu); if ( result ) { pLoop = (ILoop *)_AppGetAggregated(&IID_ILoop); @@ -218023,7 +217940,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -218037,7 +217954,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 489EB0: using guessed type char var_8[4]; //----- (00489F60) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -218067,7 +217983,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -218082,7 +217998,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cMeshTexOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -218090,7 +218006,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 48A010: using guessed type char var_C[4]; //----- (0048A0F0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -218101,7 +218016,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -218110,7 +218025,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cMeshTexOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cMeshTexOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -218125,7 +218040,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 48A180: variable 'v5' is possibly undefined -// 48A0F0: using guessed type char var_C[4]; //----- (0048A1C0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -218208,7 +218122,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -218220,7 +218134,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 48A3E0: using guessed type char var_C[4]; //----- (0048A470) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -218244,7 +218157,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (0048A4D0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -218254,7 +218167,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cMeshTexOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 48A4D0: using guessed type char var_8[4]; //----- (0048A560) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -218489,7 +218401,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -218517,7 +218429,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 48AB92: variable 'v4' is possibly undefined -// 48AAF0: using guessed type char var_10[4]; //----- (0048ABF0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -218923,7 +218834,7 @@ void __cdecl metaSndLoadGUINames(char *prefix) { sprintf(buf, "metasnd_%s_%s_%s", prefix, screens[i], posts[j]); if ( config_get_raw(buf, 0, 0) ) - config_get_raw(buf, metaSndNames[i][j], 16); + config_get_raw(buf, metaSndNames[i][j], 0x10u); else strcpy(metaSndNames[i][j], byte_B5C408); } @@ -219367,7 +219278,7 @@ void pal_set() if ( !gRenderParams.pal_res[0] ) { buf[0] = 0; - if ( config_get_raw(aDefaultGamePal, buf, 32) ) + if ( config_get_raw(aDefaultGamePal, buf, 0x20u) ) pal_res = buf; } if ( *pal_res ) @@ -220841,7 +220752,7 @@ void __cdecl mnum_report(int WarnLevel, void *data, char *buffer) { if ( !j__ObjGetScale(prop_obj, &arch_scale) ) { - *(_QWORD *)&arch_scale.el[1] = 0x3F8000003F800000i64; + *(_QWORD *)&arch_scale.el[1] = 0x3F8000003F800000LL; arch_scale.x = 1.0; } v38 = prop_obj; @@ -221442,7 +221353,7 @@ void __cdecl ParseMenu( cAnsiStr::cAnsiStr(&menuDefStr); Buffer = cAnsiStr::GetBuffer(&menuDefStr, 512); - LOBYTE(foundMenu) = config_get_raw(pszMenuTag, Buffer, 512); + LOBYTE(foundMenu) = config_get_raw(pszMenuTag, Buffer, 0x200u); foundMenu = (unsigned __int8)foundMenu; cAnsiStr::ReleaseBuffer(&menuDefStr); cAnsiStr::Trim(&menuDefStr); @@ -221528,7 +221439,7 @@ void __cdecl ParseMenu( *cAnsiStr::operator[](&continuationMenuTag, v12 - 1) = v11; v16 = cAnsiStr::GetBuffer(&menuDefStr, 512); v13 = cAnsiStr::operator char const *(&continuationMenuTag); - LOBYTE(foundMenu) = config_get_raw(v13, v16, 512); + LOBYTE(foundMenu) = config_get_raw(v13, v16, 0x200u); foundMenu = (unsigned __int8)foundMenu; cAnsiStr::ReleaseBuffer(&menuDefStr); cAnsiStr::Trim(&menuDefStr); @@ -221596,7 +221507,7 @@ void __cdecl MenuCommand(unsigned int id) } //----- (00491323) -------------------------------------------------------- -void __cdecl SetRadioCheckmark(int menu, int firstPos, int lastPos, int checkPos) +void __cdecl SetRadioCheckmark(int menu, unsigned int firstPos, unsigned int lastPos, unsigned int checkPos) { cWinMenu *MenuByNumber; // eax @@ -221772,11 +221683,7 @@ BOOL __thiscall cWinMenu::CreateMenu(cWinMenu *this) } //----- (00491A80) -------------------------------------------------------- -BOOL __thiscall cWinMenu::AppendMenuA( - cWinMenu *this, - unsigned int nFlags, - unsigned int nIDNewItem, - const char *pszNewItem) +BOOL __thiscall cWinMenu::AppendMenuA(cWinMenu *this, UINT nFlags, UINT_PTR nIDNewItem, const char *pszNewItem) { return AppendMenuA(this->m_hMenu, nFlags, nIDNewItem, pszNewItem); } @@ -221842,12 +221749,7 @@ const char *__thiscall cMenuCommands::Lookup(cMenuCommands *this, unsigned int i } //----- (00491C90) -------------------------------------------------------- -BOOL __thiscall cWinMenu::CheckMenuRadioItem( - cWinMenu *this, - unsigned int nIDFirst, - unsigned int nIDLast, - unsigned int nIDItem, - unsigned int nFlags) +BOOL __thiscall cWinMenu::CheckMenuRadioItem(cWinMenu *this, UINT nIDFirst, UINT nIDLast, UINT nIDItem, UINT nFlags) { return CheckMenuRadioItem(this->m_hMenu, nIDFirst, nIDLast, nIDItem, nFlags); } @@ -222940,7 +222842,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -222950,7 +222852,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 493B80: using guessed type char var_10[4]; //----- (00493BF0) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -222990,7 +222891,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -223003,13 +222904,15 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cMeshAttachOps *, _BYTE *, void *))this->mOps.CopyNew)( + &this->mOps, + v6, + val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 493CE0: using guessed type char var_10[4]; //----- (00493D90) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -223021,7 +222924,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -223041,7 +222944,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cMeshAttachOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cMeshAttachOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -223057,7 +222960,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 493D90: using guessed type char var_18[4]; //----- (00493EA0) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -223153,7 +223055,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -223165,7 +223067,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 494080: using guessed type char var_C[4]; //----- (00494110) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -223189,7 +223090,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -223199,7 +223100,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 494170: using guessed type char var_8[4]; //----- (00494200) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -223482,7 +223382,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -223510,7 +223410,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 49494C: variable 'v4' is possibly undefined -// 4948B0: using guessed type char var_10[4]; //----- (004949B0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -223651,7 +223550,7 @@ int __cdecl MoviePlaySynchronous(const char *pszFile, int volume) IDisplayDevice *v12; // [esp+18h] [ebp-28h] int iDisplayLock; // [esp+28h] [ebp-18h] cAutoIPtr pMoviePlayer1; // [esp+2Ch] [ebp-14h] BYREF - float oldGamma; // [esp+30h] [ebp-10h] + void *oldGamma; // [esp+30h] [ebp-10h] cFileSpec fileSpec; // [esp+34h] [ebp-Ch] BYREF cAutoIPtr pDisplayDevice; // [esp+3Ch] [ebp-4h] BYREF @@ -223669,7 +223568,7 @@ int __cdecl MoviePlaySynchronous(const char *pszFile, int volume) } else { - LODWORD(oldGamma) = g_gamma; + oldGamma = g_gamma; g_gamma = (void *)1065353216; j__gamma_update(); v12 = cIPtr::operator->(&pDisplayDevice); @@ -223689,7 +223588,7 @@ int __cdecl MoviePlaySynchronous(const char *pszFile, int volume) gr_pop_canvas(); v6 = cIPtr::operator->(&pDisplayDevice); v6->RestoreLock(v6, iDisplayLock); - g_gamma = (void *)LODWORD(oldGamma); + g_gamma = oldGamma; j__gamma_update(); cFileSpec::~cFileSpec(&fileSpec); cAutoIPtr::~cAutoIPtr(&pDisplayDevice); @@ -223712,7 +223611,7 @@ int __cdecl MoviePlayAsynchronous(const char *pszFile, int x, int y, int w, int IDisplayDevice *v14; // [esp+10h] [ebp-28h] int iDisplayLock; // [esp+20h] [ebp-18h] cAutoIPtr pMoviePlayer1; // [esp+24h] [ebp-14h] BYREF - float oldGamma; // [esp+28h] [ebp-10h] + void *oldGamma; // [esp+28h] [ebp-10h] cFileSpec fileSpec; // [esp+2Ch] [ebp-Ch] BYREF cAutoIPtr pDisplayDevice; // [esp+34h] [ebp-4h] BYREF @@ -223730,7 +223629,7 @@ int __cdecl MoviePlayAsynchronous(const char *pszFile, int x, int y, int w, int } else { - LODWORD(oldGamma) = g_gamma; + oldGamma = g_gamma; g_gamma = (void *)1065353216; j__gamma_update(); v14 = cIPtr::operator->(&pDisplayDevice); @@ -223744,7 +223643,7 @@ int __cdecl MoviePlayAsynchronous(const char *pszFile, int x, int y, int w, int v11->Play(v11, 2); v10 = cIPtr::operator->(&pDisplayDevice); v10->RestoreLock(v10, iDisplayLock); - g_gamma = (void *)LODWORD(oldGamma); + g_gamma = oldGamma; j__gamma_update(); cFileSpec::~cFileSpec(&fileSpec); cAutoIPtr::~cAutoIPtr(&pDisplayDevice); @@ -223906,7 +223805,7 @@ void __cdecl MpWriteMultiped(multiped *mp, int (__cdecl *write)(void *, void *, { int i; // [esp+0h] [ebp-4h] - write(file, mp, 4); + write(file, (void *)mp, 4); write(file, &mp->num_joints, 4); write(file, &mp->root_joint, 4); write(file, mp->joint_map, mp->num_joints); @@ -223999,7 +223898,7 @@ void __cdecl MpReadMultiped(multiped *mp, int (__cdecl *read)(void *, void *, in { int i; // [esp+0h] [ebp-4h] - read(file, mp, 4); + read(file, (void *)mp, 4); read(file, &mp->num_joints, 4); read(file, &mp->root_joint, 4); mp->joint_map = (unsigned __int8 *)mp_alloc(mp->num_joints); @@ -224209,8 +224108,6 @@ void __thiscall cNameMap::Save(cNameMap *this, ITagFile *pFile) } } } -// 4961BF: using guessed type char cHasLabel[4]; -// 4961BF: using guessed type char cHasNoLabel[4]; //----- (00496290) -------------------------------------------------------- void __thiscall cNameMap::Load(cNameMap *this, ITagFile *pFile) @@ -224254,7 +224151,6 @@ void __thiscall cNameMap::Load(cNameMap *this, ITagFile *pFile) } } // 49635D: variable 'v2' is possibly undefined -// 496290: using guessed type char cLabelTest[4]; //----- (004963AB) -------------------------------------------------------- void __thiscall cNameMap::Clear(cNameMap *this) @@ -224647,7 +224543,7 @@ eObjCastResult __cdecl ObjRaycast( } r3_use_context(sim_context); r3_set_view_canvas(grd_canvas); - r3_set_space(1u); + r3_set_space(R3_PROJECT_SPACE); for ( i = 0; i < PortalRaycastRefCount; ++i ) { g_iCell = PortalRaycastRef[i]; @@ -224736,7 +224632,7 @@ int __cdecl MDDetect() //----- (0049727F) -------------------------------------------------------- int __cdecl MeshDetect() { - int iBuffSize; // [esp+0h] [ebp-10h] + unsigned int iBuffSize; // [esp+0h] [ebp-10h] void *pBuff; // [esp+4h] [ebp-Ch] int rv; // [esp+8h] [ebp-8h] _mms_model *pModel; // [esp+Ch] [ebp-4h] @@ -226479,7 +226375,7 @@ void objmodelReset() int objmodelFreeAllModels() { int result; // eax - int i; // [esp+0h] [ebp-4h] + signed int i; // [esp+0h] [ebp-4h] for ( i = 0; i < 1024; ++i ) { @@ -226797,7 +226693,7 @@ char *__cdecl objmodelGetName(unsigned int idx) { char *name; // [esp+0h] [ebp-8h] - if ( idx > 0x3FF || !byte_B5DC1E[16 * idx] ) + if ( idx >= 0x400 || !byte_B5DC1E[16 * idx] ) return 0; name = FindFXNameByIdx(idx); if ( !name ) @@ -226827,7 +226723,7 @@ int __cdecl objmodelMaxModel() //----- (0049B765) -------------------------------------------------------- int __cdecl objmodelGetModelType(unsigned int idx) { - if ( idx <= 0x3FF && byte_B5DC1E[16 * idx] ) + if ( idx < 0x400 && byte_B5DC1E[16 * idx] ) return word_B5DC1C[8 * idx]; else return 0; @@ -226837,7 +226733,7 @@ int __cdecl objmodelGetModelType(unsigned int idx) //----- (0049B79C) -------------------------------------------------------- void *__cdecl objmodelGetModel(unsigned int idx) { - if ( idx > 0x3FF || !byte_B5DC1E[16 * idx] ) + if ( idx >= 0x400 || !byte_B5DC1E[16 * idx] ) return 0; if ( g_aModelHandles[idx].mhandle ) return g_aModelHandles[idx].mhandle->DataPeek(g_aModelHandles[idx].mhandle); @@ -227513,7 +227409,6 @@ void __thiscall cPosProp::LoadEOSPoses(cPosProp *this, ITagFile *file) } } } -// 49D281: using guessed type unsigned __int8 phylum[4]; //----- (0049D930) -------------------------------------------------------- void __thiscall cZeroPos::cZeroPos(cZeroPos *this) @@ -228005,7 +227900,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -228033,7 +227928,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 49E6FC: variable 'v4' is possibly undefined -// 49E660: using guessed type char var_10[4]; //----- (0049E760) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -228096,7 +227990,7 @@ sDatum *__stdcall cArrayPropertyStore::Create( int __$ReturnUdt) { sDatum *v3; // eax - char v5[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&val, 0); @@ -228111,7 +228005,6 @@ sDatum *__stdcall cArrayPropertyStore::Create( result->value = val.value; return result; } -// 49E8E0: using guessed type char var_8[4]; //----- (0049E980) -------------------------------------------------------- int __stdcall cArrayPropertyStore::Delete(cArrayPropertyStore *this, int obj) @@ -228171,7 +228064,7 @@ int __stdcall cArrayPropertyStore::Set(cArrayPropertyStore { sDatum *v4; // eax void *v5; // esi - char v6[4]; // [esp+4h] [ebp-4h] BYREF + _BYTE v6[4]; // [esp+4h] [ebp-4h] BYREF if ( !cArrayPropertyStore::InBounds(this, obj) ) return -2147467259; @@ -228183,13 +228076,12 @@ int __stdcall cArrayPropertyStore::Set(cArrayPropertyStore } else { - v5 = *(void **)((int (__stdcall *)(cPosOps *, char *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); + v5 = *(void **)((int (__stdcall *)(cPosOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); cObjArray::operator[](&this->mArray, obj)->value = v5; cArrayPropertyStore::SetInUse(this, obj); return 0; } } -// 49EB70: using guessed type char var_4[4]; //----- (0049EC30) -------------------------------------------------------- sDatum *__stdcall cArrayPropertyStore::Copy( @@ -228201,7 +228093,7 @@ sDatum *__stdcall cArrayPropertyStore::Copy( void **v4; // eax sDatum *v6; // eax void *v7; // esi - char v8[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v8[4]; // [esp+4h] [ebp-Ch] BYREF sDatum v9; // [esp+8h] [ebp-8h] BYREF sDatum val; // [esp+Ch] [ebp-4h] @@ -228217,7 +228109,7 @@ sDatum *__stdcall cArrayPropertyStore::Copy( } else { - v7 = *(void **)((int (__stdcall *)(cPosOps *, char *, void *))this->mOps.CopyNew)(&this->mOps, v8, val.value); + v7 = *(void **)((int (__stdcall *)(cPosOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v8, val.value); cObjArray::operator[](&this->mArray, __$ReturnUdt)->value = v7; cArrayPropertyStore::SetInUse(this, __$ReturnUdt); } @@ -228232,7 +228124,6 @@ sDatum *__stdcall cArrayPropertyStore::Copy( } } // 49EC71: variable 'v4' is possibly undefined -// 49EC30: using guessed type char var_C[4]; //----- (0049ED50) -------------------------------------------------------- int __stdcall cArrayPropertyStore::Reset(cArrayPropertyStore *this) @@ -228313,7 +228204,7 @@ int __stdcall cPropertyStore::WriteObj(cPropertyStore *this, i //----- (0049EF50) -------------------------------------------------------- int __stdcall cPropertyStore::ReadObj(cPropertyStore *this, int obj, IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -228325,7 +228216,6 @@ int __stdcall cPropertyStore::ReadObj(cPropertyStore *this, in ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 49EF50: using guessed type char var_C[4]; //----- (0049EFE0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -228349,7 +228239,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, IDa //----- (0049F040) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -228359,7 +228249,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, in ((void (__stdcall *)(cPosOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 49F040: using guessed type char var_8[4]; //----- (0049F0D0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -229095,7 +228984,7 @@ void __thiscall cDListNode,1>::cDListNode::ZeroBounds() { - return 0i64; + return 0LL; } //----- (004A0390) -------------------------------------------------------- @@ -229104,17 +228993,16 @@ void __thiscall cObjArray::AutoConnect(cObjArray *this) IObjIDManager *Aggregated; // eax const sObjBounds *v2; // eax IObjIDManager *v3; // [esp+8h] [ebp-18h] - char v5[8]; // [esp+14h] [ebp-Ch] BYREF + _BYTE v5[8]; // [esp+14h] [ebp-Ch] BYREF cAutoIPtr pObjIDManager; // [esp+1Ch] [ebp-4h] BYREF Aggregated = (IObjIDManager *)_AppGetAggregated(&IID_IObjIDManager); cAutoIPtr::cAutoIPtr(&pObjIDManager, Aggregated); v3 = cIPtr::operator->(&pObjIDManager); - v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, char *))v3->GetObjIDBounds)(v3, v5); + v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, _BYTE *))v3->GetObjIDBounds)(v3, v5); cObjArray::Resize(this, v2); cAutoIPtr::~cAutoIPtr(&pObjIDManager); } -// 4A0390: using guessed type char var_C[8]; //----- (004A0470) -------------------------------------------------------- void __thiscall cObjArray::AutoDisconnect(cObjArray *this) @@ -229149,13 +229037,13 @@ void __thiscall cArrayPropertyStore::AutoConnect(cArrayPropertyStore< IObjIDSink *v6; // [esp+4h] [ebp-1Ch] IObjIDManager *v7; // [esp+8h] [ebp-18h] cArrayPropObjIDSink > *v9; // [esp+10h] [ebp-10h] - char v10[8]; // [esp+14h] [ebp-Ch] BYREF + _BYTE v10[8]; // [esp+14h] [ebp-Ch] BYREF cAutoIPtr pObjIDManager; // [esp+1Ch] [ebp-4h] BYREF Aggregated = (IObjIDManager *)_AppGetAggregated(&IID_IObjIDManager); cAutoIPtr::cAutoIPtr(&pObjIDManager, Aggregated); v7 = cIPtr::operator->(&pObjIDManager); - v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, char *))v7->GetObjIDBounds)(v7, v10); + v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, _BYTE *))v7->GetObjIDBounds)(v7, v10); cArrayPropertyStore::Resize(this, v2); v9 = (cArrayPropObjIDSink > *)j__new(0xCu, aRPrjThief2Skup_1105, 326); if ( v9 ) @@ -229174,7 +229062,6 @@ void __thiscall cArrayPropertyStore::AutoConnect(cArrayPropertyStore< cAutoIPtr::~cAutoIPtr(&pObjIDManager); } // 4A0568: variable 'v3' is possibly undefined -// 4A0500: using guessed type char var_C[8]; //----- (004A05D0) -------------------------------------------------------- void __thiscall cArrayPropertyStore::AutoDisconnect(cArrayPropertyStore *this) @@ -229569,7 +229456,7 @@ void __cdecl LoadObjMappingTable(ITagFile *pFile) ITraitManager *v7; // [esp+0h] [ebp-60h] ITraitManager *v8; // [esp+4h] [ebp-5Ch] IObjectSystem *v9; // [esp+8h] [ebp-58h] - int v10; // [esp+Ch] [ebp-54h] + BOOL v10; // [esp+Ch] [ebp-54h] cHashTable > *v11; // [esp+10h] [ebp-50h] cHashTable > *v12; // [esp+20h] [ebp-40h] int missing; // [esp+30h] [ebp-30h] BYREF @@ -230575,7 +230462,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -231162,9 +231049,9 @@ double __cdecl GetSparkRadius() //----- (004A411A) -------------------------------------------------------- int __cdecl GetSparkObjRelBBox(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax) { - *(_QWORD *)&bmin->x = 0i64; + *(_QWORD *)&bmin->x = 0LL; bmin->z = 0.0; - *(_QWORD *)&bmax->x = 0i64; + *(_QWORD *)&bmax->x = 0LL; bmax->z = 0.0; return 0; } @@ -231273,8 +231160,7 @@ int __cdecl GetBitmapWorldBBox(int obj, int idx, mxs_vector *bmin, mxs_vector *b //----- (004A440A) -------------------------------------------------------- float __cdecl ObjGetRadius(int obj) { - char *v1; // eax - double v2; // st7 + char *v2; // eax unsigned int type; // [esp+0h] [ebp-8h] int idx; // [esp+4h] [ebp-4h] BYREF @@ -231284,19 +231170,17 @@ float __cdecl ObjGetRadius(int obj) type = j__objmodelGetModelType(idx); if ( type >= 7 ) { - v1 = _LogFmt("ObjGetRadius: model type %d not supported\n", type); - _CriticalMsg(v1, aRPrjThief2Skup_2482, 0x307u); + v2 = _LogFmt("ObjGetRadius: model type %d not supported\n", type); + _CriticalMsg(v2, aRPrjThief2Skup_2482, 0x307u); } return g_aObjShapeFuncs[type].radFunc(obj, idx); } else { - g_aObjShapeFuncs[0].radFunc(obj, idx); + return ((double (__cdecl *)(int))g_aObjShapeFuncs[0].radFunc)(obj); } - return v2; } // 9C4280: invalid function type 'ObjShapeFuncs g_aObjShapeFuncs[7]' has been ignored -// 4A4493: variable 'v2' is possibly undefined //----- (004A4497) -------------------------------------------------------- BOOL __cdecl ObjGetObjRelBBoxUnscaled(int obj, mxs_vector *bmin, mxs_vector *bmax) @@ -231321,7 +231205,7 @@ BOOL __cdecl ObjGetObjRelBBoxUnscaled(int obj, mxs_vector *bmin, mxs_vector *bma return v5 == 0; } // 4A455D: variable 'v5' is possibly undefined -// 9C4284: using guessed type int (__cdecl *off_9C4284)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4284: using guessed type int (__cdecl *off_9C4284)(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax); //----- (004A4566) -------------------------------------------------------- BOOL __cdecl ObjGetObjRelBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) @@ -231349,7 +231233,7 @@ BOOL __cdecl ObjGetObjRelBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) return 1; } // 4A462E: variable 'v5' is possibly undefined -// 9C4284: using guessed type int (__cdecl *off_9C4284)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4284: using guessed type int (__cdecl *off_9C4284)(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax); //----- (004A4651) -------------------------------------------------------- BOOL __cdecl ObjGetObjOffsetBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) @@ -231374,7 +231258,7 @@ BOOL __cdecl ObjGetObjOffsetBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) return v5 == 1; } // 4A471A: variable 'v5' is possibly undefined -// 9C4288: using guessed type int (__cdecl *off_9C4288)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4288: using guessed type int (__cdecl *off_9C4288)(int obj, int idx, mxs_vector *bmin, mxs_vector *bmax); //----- (004A4723) -------------------------------------------------------- BOOL __cdecl ObjGetWorldBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) @@ -231397,7 +231281,7 @@ BOOL __cdecl ObjGetWorldBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) return v5 == 2; } // 4A47C3: variable 'v5' is possibly undefined -// 9C428C: using guessed type int (__cdecl *off_9C428C)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C428C: using guessed type int (__cdecl *off_9C428C)(int obj, int idx, mxs_vector *bmin, mxs_vector *bmax); //----- (004A47CF) -------------------------------------------------------- void __cdecl ObjGetObjRelVhot(int obj, int vhot, mxs_vector *pos) @@ -231424,7 +231308,7 @@ void __cdecl ObjGetObjRelVhot(int obj, int vhot, mxs_vector *pos) off_9C4294(obj, idx, vhot, pos); } } -// 9C4294: using guessed type int (__cdecl *off_9C4294)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4294: using guessed type void (__cdecl *off_9C4294)(int objID, int idx, int vhot, mxs_vector *pos); //----- (004A488E) -------------------------------------------------------- void __cdecl ObjGetObjOffsetVhot(int obj, int vhot, mxs_vector *pos) @@ -231451,7 +231335,7 @@ void __cdecl ObjGetObjOffsetVhot(int obj, int vhot, mxs_vector *pos) off_9C4298(obj, idx, vhot, pos); } } -// 9C4298: using guessed type int (__cdecl *off_9C4298)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4298: using guessed type void (__cdecl *off_9C4298)(int objID, int idx, int vhot, mxs_vector *pos); //----- (004A494D) -------------------------------------------------------- int __cdecl ObjGetUnscaledDims(int obj, mxs_vector *dims) @@ -231495,7 +231379,7 @@ int __cdecl ObjGetFavoriteBBox(int obj, mxs_vector *bmin, mxs_vector *bmax) return bbox; } // 4A4A28: variable 'v4' is possibly undefined -// 9C4290: using guessed type int (__cdecl *off_9C4290)(_DWORD, _DWORD, _DWORD, _DWORD); +// 9C4290: using guessed type int (__cdecl *off_9C4290)(int __formal, int a2, mxs_vector *bmin, mxs_vector *bmax); //----- (004A4FE0) -------------------------------------------------------- int ResetObjTimerStats() @@ -232257,7 +232141,7 @@ int __thiscall cObjectSystem::LoadActiveArray(cObjectSystem *this, ITagFile *fil int offset; // [esp+4Ch] [ebp-10h] unsigned __int8 *tempArray; // [esp+50h] [ebp-Ch] VersionNum v; // [esp+54h] [ebp-8h] BYREF - int partitiona; // [esp+68h] [ebp+Ch] + unsigned int partitiona; // [esp+68h] [ebp+Ch] v = VecVersion; if ( file->OpenBlock(file, &VecTag, &v) >= 0 ) @@ -232410,7 +232294,7 @@ int __stdcall cObjectSystem::DatabaseNotify(cObjectSystem *this, unsigned int ms default: break; } - if ( (msg & 0x800000FF) == -2147483645 ) + if ( (msg & 0x800000FF) == 0x80000003 ) this->TraitMan->Notify(this->TraitMan, msg, raw); this->LinkMan->Notify(this->LinkMan, msg, raw); ((void (__thiscall *)(IPropertyManager *, IPropertyManager *, unsigned int, ITagFile *))this->PropMan->Notify)( @@ -232418,18 +232302,18 @@ int __stdcall cObjectSystem::DatabaseNotify(cObjectSystem *this, unsigned int ms this->PropMan, msg, raw); - if ( (msg & 0x800000FF) != -2147483645 ) + if ( (msg & 0x800000FF) != 0x80000003 ) ((void (__thiscall *)(ITraitManager *, ITraitManager *, unsigned int, ITagFile *))this->TraitMan->Notify)( this->TraitMan, this->TraitMan, msg, raw); - if ( (msg & 0x800000FF) == -2147483646 ) + if ( (msg & 0x800000FF) == 0x80000002 ) { if ( !config_get_raw(aSaveTransients_0, 0, 0) ) unhide_transients(this->Transient); } - else if ( (msg & 0x800000FF) == -2147483644 ) + else if ( (msg & 0x800000FF) == 0x80000004 ) { cObjectSystem::send_post_load(this, msg & 0xFF00); if ( (msg & 0xFF00) == 0 ) @@ -232805,11 +232689,11 @@ unsigned int __stdcall cObjectSystem::Listen(cObjectSystem *this, sObjListenerDe //----- (004A7894) -------------------------------------------------------- int __stdcall cObjectSystem::Unlisten(cObjectSystem *this, int handle) { - int newsize; // [esp+0h] [ebp-4h] + unsigned int newsize; // [esp+0h] [ebp-4h] cDABase>::operator[](&this->mListeners, handle)->func = 0; for ( newsize = cDABase>::Size(&this->mListeners); - newsize - 1 >= 0 + (int)(newsize - 1) >= 0 && !cDABase>::operator[](&this->mListeners, newsize - 1)->func; --newsize ) { @@ -235480,7 +235364,7 @@ void __cdecl palmgr_update_pal_slot(int slot) else if ( bitDepth > 0xEu && bitDepth <= 0x10u ) { if ( g_lgd3d ) - lgd3d_set_pal_slot(0, 256, info->pal_data, slot); + lgd3d_set_pal_slot(0, 0x100u, info->pal_data, slot); ((void (__cdecl *)(grs_rgb_bitmask *))grd_device_table[15])(&bmask); if ( !info->pal16 ) info->pal16 = (unsigned __int16 *)MallocSpew(0x200u, aRPrjThief2Skup_2444, 286); @@ -235676,7 +235560,7 @@ int __cdecl palmgr_alloc_pal(unsigned __int8 *pal) // 4AD5A6: variable 'info' is possibly undefined //----- (004AD5F7) -------------------------------------------------------- -void __cdecl palmgr_release_slot(int slot) +void __cdecl palmgr_release_slot(unsigned int slot) { if ( palmgr_verify_slot(slot, aPalmgrReleaseS) ) { @@ -235710,7 +235594,7 @@ int __cdecl palmgr_verify_slot(unsigned int slot, char *func) } //----- (004AD6BD) -------------------------------------------------------- -void __cdecl palmgr_add_ref_slot(int slot) +void __cdecl palmgr_add_ref_slot(unsigned int slot) { char *v1; // eax @@ -235726,7 +235610,7 @@ void __cdecl palmgr_add_ref_slot(int slot) } //----- (004AD735) -------------------------------------------------------- -void __cdecl palmgr_free_ipal(int slot) +void __cdecl palmgr_free_ipal(unsigned int slot) { pal_info *info; // [esp+0h] [ebp-4h] @@ -235742,7 +235626,7 @@ void __cdecl palmgr_free_ipal(int slot) } //----- (004AD791) -------------------------------------------------------- -unsigned __int8 *__cdecl palmgr_get_ipal(int slot) +unsigned __int8 *__cdecl palmgr_get_ipal(unsigned int slot) { pal_info *info; // [esp+0h] [ebp-4h] @@ -235771,7 +235655,7 @@ unsigned __int8 *__cdecl palmgr_get_ipal(int slot) } //----- (004AD894) -------------------------------------------------------- -unsigned __int8 *__cdecl palmgr_get_pal(int slot) +unsigned __int8 *__cdecl palmgr_get_pal(unsigned int slot) { if ( palmgr_verify_slot(slot, aPalmgrGetPal) ) return pal_list[slot].pal_data; @@ -235835,7 +235719,7 @@ int __cdecl palmgr_get_current_count(int mono_print) //----- (004ADD70) -------------------------------------------------------- unsigned __int8 __cdecl cPanelLoopClient::PanelEventHandler(_ui_event *ev, _Region *reg, _DWORD **data) { - int potent; // [esp+8h] [ebp-8h] + BOOL potent; // [esp+8h] [ebp-8h] unsigned int flags; // [esp+Ch] [ebp-4h] flags = *(_DWORD *)((*(int (__thiscall **)(_DWORD *, _DWORD *))(*data[2] + 12))(data[2], data[2]) + 4); @@ -235982,7 +235866,7 @@ void __thiscall cPanelMode::SetupLoopMode(cPanelMode *this) name.pID = this->mPanelDesc.id; strcpy(name.szName, "Panel Mode"); memset(&name.szName[11], 0, 21); - qmemcpy(&this->mLoopDesc, &name, 0x24u); + qmemcpy((void *)&this->mLoopDesc, &name, 0x24u); this->mLoopDesc.nClients = 5; this->mLoopDesc.ppClientIDs = (const _GUID **)j__new(0x14u, aRPrjThief2Skup_2431, 337); memcpy(this->mLoopDesc.ppClientIDs, Clients, 0x14u); @@ -235990,7 +235874,7 @@ void __thiscall cPanelMode::SetupLoopMode(cPanelMode *this) v3 = cIPtr::operator->(&pLoopMan); v3->AddMode(v3, &this->mLoopDesc); } - memset(&this->mInst, 0, sizeof(this->mInst)); + memset((void *)&this->mInst, 0, sizeof(this->mInst)); this->mInst.pID = this->mPanelDesc.id; this->SetParams(this, 0); cAutoIPtr::~cAutoIPtr(&pLoopMan); @@ -236020,7 +235904,7 @@ void __thiscall cPanelMode::CleanupLoopMode(cPanelMode *this) void __thiscall cPanelMode::cPanelMode(cPanelMode *this, const sPanelModeDesc *desc) { cCTUnaggregated::cCTUnaggregated(this); - qmemcpy(&this->mPanelDesc, desc, sizeof(this->mPanelDesc)); + qmemcpy((void *)&this->mPanelDesc, desc, sizeof(this->mPanelDesc)); this->mScrnParm = def_scrnparm; this->__vftable = (cPanelMode_vtbl *)&cPanelMode::`vftable'; create_panel_factory(); @@ -236043,7 +235927,7 @@ void create_panel_factory() { descs[0] = &cPanelLoopClient::Descriptor; descs[1] = 0; - fact = CreateLoopFactory((sLoopClientDesc **)descs); + fact = CreateLoopFactory(descs); Aggregated = (ILoopManager *)_AppGetAggregated(&IID_ILoopManager); cAutoIPtr::cAutoIPtr(&pLoopMan, Aggregated); v1 = fact; @@ -236189,7 +236073,7 @@ int __stdcall cPanelMode::Exit(cPanelMode *this) { transition = this->mPanelDesc.transition; v5 = cIPtr::operator->(&pLoop); - v5->ChangeMode(v5, transition.change, (sLoopInstantiator *)transition.mode); + v5->ChangeMode(v5, transition.change, transition.mode); } else { @@ -236215,7 +236099,7 @@ int __stdcall cPanelMode::Switch(cPanelMode *this, int change, sLoopModeInitParm cAutoIPtr::cAutoIPtr(&pLoop, Aggregated); v5 = this->Instantiator(this); v6 = cIPtr::operator->(&pLoop); - v6->ChangeMode(v6, change, (sLoopInstantiator *)v5); + v6->ChangeMode(v6, change, v5); cAutoIPtr::~cAutoIPtr(&pLoop); return 0; } @@ -236283,10 +236167,10 @@ _GUImethods *__cdecl panel_gui_methods(IPanelMode *mode) if ( (__S2__1__panel_gui_methods__YAPAU_GUImethods__PAUIPanelMode___Z_4EA & 1) == 0 ) { __S2__1__panel_gui_methods__YAPAU_GUImethods__PAUIPanelMode___Z_4EA |= 1u; - methods_0.setpal = DefaultGUImethods.setpal; + methods.setpal = DefaultGUImethods.setpal; } gpGUImode = mode; - return &methods_0; + return &methods; } //----- (004AEC20) -------------------------------------------------------- @@ -236341,7 +236225,7 @@ const sPanelModeDesc *__stdcall cPanelMode::Describe(cPanelMode *this) //----- (004AED70) -------------------------------------------------------- int __stdcall cPanelMode::SetDescription(cPanelMode *this, const sPanelModeDesc *desc) { - qmemcpy(&this->mPanelDesc, desc, sizeof(this->mPanelDesc)); + qmemcpy((void *)&this->mPanelDesc, desc, sizeof(this->mPanelDesc)); return 0; } @@ -236604,7 +236488,7 @@ void __cdecl ParticlesDelete(unsigned int index) IObjectSystem *v3; // [esp+0h] [ebp-8h] cAutoIPtr ObjSys; // [esp+4h] [ebp-4h] BYREF - if ( index > 0x7F ) + if ( index >= 0x80 ) { DbgReportWarning("ParticlesDelete - invalid index %d!\n", index); } @@ -237168,7 +237052,7 @@ void __cdecl setup_initial_particle_lists(st_ParticleGroup *pg) { __int64 v1; // rax double v2; // [esp+0h] [ebp-10h] - int i; // [esp+8h] [ebp-8h] + signed int i; // [esp+8h] [ebp-8h] Position *p; // [esp+Ch] [ebp-4h] ComputeObjMat(pg); @@ -237189,7 +237073,7 @@ void __cdecl setup_initial_particle_lists(st_ParticleGroup *pg) } else { - *(_QWORD *)&cur_loc.x = 0i64; + *(_QWORD *)&cur_loc.x = 0LL; cur_loc.z = 0.0; } pg->prev_loc = cur_loc; @@ -237330,13 +237214,13 @@ void __cdecl determine_launch_loc(st_ParticleGroup *pg, mxs_vector *launch_pt) } //----- (004B0E32) -------------------------------------------------------- -void __cdecl update_particles(st_ParticleGroup *pg, int index, int num, int time) +void __cdecl update_particles(st_ParticleGroup *pg, unsigned int index, int num, int time) { float v4; // [esp+4h] [ebp-14h] float s; // [esp+8h] [ebp-10h] int time_left; // [esp+Ch] [ebp-Ch] unsigned int i; // [esp+10h] [ebp-8h] - int particle_gravity; // [esp+14h] [ebp-4h] + BOOL particle_gravity; // [esp+14h] [ebp-4h] int numa; // [esp+28h] [ebp+10h] particle_gravity = pg->motion_type != PGMT_VELOCITY_GRAVITY; @@ -237557,7 +237441,7 @@ void ParticleGroupUpdateModeFinish() void __cdecl particle_group_update_mode_change(int obj) { st_ParticleGroup *pg; // [esp+4h] [ebp-8h] - int alpha; // [esp+8h] [ebp-4h] + BOOL alpha; // [esp+8h] [ebp-4h] if ( gRenderMode ) { @@ -238236,10 +238120,10 @@ void __cdecl RenderBitmap(st_ParticleGroup *pg, int *list) ptlist[0].coord[2] = 0.0; ptlist[3].coord[2] = 1.0; ptlist[2].coord[2] = 1.0; - *(_QWORD *)ptlist[3].coord = 1065353216i64; - *(_QWORD *)ptlist[2].coord = 0x3F8000003F800000i64; - *(_QWORD *)ptlist[1].coord = 0x3F8000003F800000i64; - *(_QWORD *)ptlist[0].coord = 1065353216i64; + *(_QWORD *)ptlist[3].coord = 1065353216LL; + *(_QWORD *)ptlist[2].coord = 0x3F8000003F800000LL; + *(_QWORD *)ptlist[1].coord = 0x3F8000003F800000LL; + *(_QWORD *)ptlist[0].coord = 1065353216LL; i = 0; while ( 1 ) { @@ -238641,10 +238525,10 @@ void __cdecl pgroup_trailing_sim(st_ParticleGroup *pg, float simtime) } //----- (004B3B3F) -------------------------------------------------------- -int __cdecl particle_launch_sim(st_ParticleGroup *pg, float time) +BOOL __cdecl particle_launch_sim(st_ParticleGroup *pg, float time) { int fix_time; // [esp+0h] [ebp-8h] - int expired; // [esp+4h] [ebp-4h] + BOOL expired; // [esp+4h] [ebp-4h] fix_time = (__int64)(time * 65536.0); if ( pg->pl.n > pg->n ) @@ -238740,7 +238624,7 @@ void __cdecl compute_launch_minmax(st_ParticleGroup *pg) float b2; // [esp+58h] [ebp-Ch] float b2a; // [esp+58h] [ebp-Ch] int i; // [esp+5Ch] [ebp-8h] - int particle_gravity; // [esp+60h] [ebp-4h] + BOOL particle_gravity; // [esp+60h] [ebp-4h] particle_gravity = pg->motion_type != PGMT_VELOCITY_GRAVITY; for ( i = 0; i < 3; ++i ) @@ -238978,7 +238862,7 @@ int __cdecl GetParticleFavoriteBBox(int objID, int idx, mxs_vector *bmin, mxs_ve int __stdcall cPGroupLaunchInfoOps::Read(cPGroupLaunchInfoOps *this, sDatum *pdat, IDataOpsFile *file, int verison) { sDatum *v4; // eax - char v6[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v6[4]; // [esp+0h] [ebp-8h] BYREF st_ParticleLaunchInfo *launch_info; // [esp+4h] [ebp-4h] if ( !pdat->value ) @@ -239004,7 +238888,6 @@ int __stdcall cPGroupLaunchInfoOps::Read(cPGroupLaunchInfoOps *this, sDatum *pda file->Read(file, launch_info->time_range, 8); return 0; } -// 4B5940: using guessed type char var_8[4]; //----- (004B5AB5) -------------------------------------------------------- void __cdecl object_listen_func(int obj, unsigned int msg) @@ -239369,7 +239252,7 @@ int __cdecl getAttachmentLocation(Location *loc, st_ParticleGroup *pg) } return 0; case 1: - *(_QWORD *)&loc->vec.el[1] = 0i64; + *(_QWORD *)&loc->vec.el[1] = 0LL; loc->vec.x = 0.0; j__FindVhotLocation(&loc->vec, obj2, data->vhot); if ( loc->cell == -1 ) @@ -240720,8 +240603,8 @@ void __thiscall cNonDeletingStore::cNonDeletingStoreSet)(this, obj, dat.value); return 0; } -// 4B8B70: using guessed type char var_28[4]; -// 4B8B70: using guessed type char var_2C[4]; //----- (004B9650) -------------------------------------------------------- const sPropertyStoreDesc *__stdcall cHashPropertyStore::Describe( @@ -240886,7 +240767,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -240900,7 +240781,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4B9660: using guessed type char var_8[4]; //----- (004B9710) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -240936,7 +240816,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -240951,7 +240831,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cParticleGroupOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cParticleGroupOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -240959,7 +240839,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4B97C0: using guessed type char var_C[4]; //----- (004B98A0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -240970,7 +240849,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -240979,7 +240858,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cParticleGroupOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cParticleGroupOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -240994,7 +240873,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4B9930: variable 'v5' is possibly undefined -// 4B98A0: using guessed type char var_C[4]; //----- (004B9970) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -241098,7 +240976,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -241108,7 +240986,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4B9BF0: using guessed type char var_8[4]; //----- (004B9C80) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -241198,7 +241075,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -241212,7 +241089,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4B9E20: using guessed type char var_8[4]; //----- (004B9ED0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -241250,7 +241126,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -241265,7 +241141,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cPGroupLaunchInfoOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cPGroupLaunchInfoOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -241273,7 +241149,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4B9F80: using guessed type char var_C[4]; //----- (004BA060) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -241284,7 +241159,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -241293,7 +241168,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cPGroupLaunchInfoOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cPGroupLaunchInfoOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -241308,7 +241183,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4BA0F0: variable 'v5' is possibly undefined -// 4BA060: using guessed type char var_C[4]; //----- (004BA130) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -241397,7 +241271,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -241409,7 +241283,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4BA350: using guessed type char var_C[4]; //----- (004BA3E0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -241439,7 +241312,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -241449,7 +241322,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cPGroupLaunchInfoOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4BA440: using guessed type char var_8[4]; //----- (004BA4D0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -241585,7 +241457,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -241597,7 +241469,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4BA790: using guessed type char var_C[4]; //----- (004BA850) -------------------------------------------------------- cPGroupLaunchInfoStore *__thiscall cPGroupLaunchInfoStore::`vector deleting destructor'( @@ -241808,7 +241679,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -241836,7 +241707,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4BADE2: variable 'v4' is possibly undefined -// 4BAD40: using guessed type char var_10[4]; //----- (004BAE40) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -242080,7 +241950,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -242108,7 +241978,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4BB442: variable 'v4' is possibly undefined -// 4BB3A0: using guessed type char var_10[4]; //----- (004BB4A0) -------------------------------------------------------- void __thiscall cProperty::SetStore( @@ -242522,7 +242391,7 @@ void __cdecl init_game_cfg_vars(const char *name) break; var = *cDABase>::operator[](&Vars, i); newvar = &var->name[strlen(prefix)]; - config_get_raw(var->name, valbuf, 80); + config_get_raw(var->name, valbuf, 0x50u); config_set_string(newvar, valbuf); config_set_priority(newvar, 0); *cDABase>::operator[](&Vars, i) = 0; @@ -242721,7 +242590,7 @@ void __cdecl GetStoreTime(char *arg) sPropTimeStats *stats; // [esp+14h] [ebp-78h] IPropertyStats *pStats; // [esp+18h] [ebp-74h] BYREF int result; // [esp+1Ch] [ebp-70h] - char buf[9]; // [esp+20h] [ebp-6Ch] BYREF + char buf[12]; // [esp+20h] [ebp-6Ch] BYREF int i; // [esp+2Ch] [ebp-60h] IProperty *prop; // [esp+30h] [ebp-5Ch] sPropTimeStats totals; // [esp+34h] [ebp-58h] BYREF @@ -243176,7 +243045,7 @@ void showNetTimes() //----- (004BCF22) -------------------------------------------------------- void __cdecl CheatCheckToggleBool(unsigned __int8 *var, char *cmd, char *name) { - int new_val; // [esp+4h] [ebp-4h] + BOOL new_val; // [esp+4h] [ebp-4h] new_val = *var == 0; if ( cheats_active ) @@ -243215,12 +243084,12 @@ void __cdecl EnableCheats(int val) } //----- (004BCFE0) -------------------------------------------------------- -int __cdecl ComputeCheatCode() +size_t __cdecl ComputeCheatCode() { const _Version *ver; // [esp+0h] [ebp-10h] int vtotal; // [esp+4h] [ebp-Ch] const char *username; // [esp+8h] [ebp-8h] - int utotal; // [esp+Ch] [ebp-4h] + size_t utotal; // [esp+Ch] [ebp-4h] ver = j__AppVersion(); vtotal = (ver->num.major + 1) * (ver->num.minor + 1); @@ -243261,7 +243130,7 @@ int PlaytestInitReal() result = config_get_raw(aLanguage_2, 0, 0); if ( result ) { - config_get_raw(aLanguage_3, buf, 128); + config_get_raw(aLanguage_3, buf, 0x80u); result = _strcmpi(buf, aEnglish_0); if ( result ) cheats_active = 1; @@ -245576,11 +245445,11 @@ void __thiscall cPlayerMode::Write(cPlayerMode *this, ITagFile *file) } //----- (004C1871) -------------------------------------------------------- -void __thiscall cPlayerMode::SetMode(cPlayerMode *this, unsigned int mode) +void __thiscall cPlayerMode::SetMode(cPlayerMode *this, ePlayerMode mode) { - int mode_changed; // [esp+4h] [ebp-4h] + BOOL mode_changed; // [esp+4h] [ebp-4h] - if ( mode >= 8 ) + if ( (unsigned int)mode >= kPM_NumModes ) _CriticalMsg(aMode0ModeKpmNu, aRPrjThief2Skup_2352, 0x14Bu); if ( config_get_raw(aPlayermodespew, 0, 0) ) mprintf("Setting mode to %d\n", mode); @@ -247595,7 +247464,7 @@ void __thiscall sBodyMsg::sBodyMsg( int obj_to, sBodyMsg::eBodyAction action, const char *motionName, - int flagValue) + unsigned int flagValue) { sScrMsg::sScrMsg(this); this->ActionType = action; @@ -248031,7 +247900,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -248059,7 +247928,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4C67DC: variable 'v4' is possibly undefined -// 4C6740: using guessed type char var_10[4]; //----- (004C6840) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -248085,7 +247953,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -248095,7 +247963,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 4C6890: using guessed type char var_10[4]; //----- (004C6900) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -248135,7 +248002,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore { sObjDatumPair *v3; // eax sDatum *v5; // eax - char v6[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v6[4]; // [esp+0h] [ebp-10h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-Ch] BYREF cSimpleDListNode *node; // [esp+Ch] [ebp-4h] @@ -248148,13 +248015,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore } else { - v5 = (sDatum *)((int (__stdcall *)(cPuppetOps *, char *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cPuppetOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 4C69F0: using guessed type char var_10[4]; //----- (004C6AA0) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -248166,7 +248032,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -248186,7 +248052,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cPuppetOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cPuppetOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -248202,7 +248068,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 4C6AA0: using guessed type char var_18[4]; //----- (004C6BB0) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -248293,7 +248158,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -248305,7 +248170,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4C6D90: using guessed type char var_C[4]; //----- (004C6E20) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -248329,7 +248193,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (004C6E80) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -248339,7 +248203,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cPuppetOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4C6E80: using guessed type char var_8[4]; //----- (004C6F10) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -249001,7 +248864,7 @@ int __stdcall cQuestData::UnsubscribeMsg(cQuestData *this, int objID, const char cSimpleDListNode *v8; // eax const char *v9; // [esp-4h] [ebp-30h] cSimpleDListIter result; // [esp+Ch] [ebp-20h] BYREF - int v11; // [esp+14h] [ebp-18h] + cQuestDataNode *v11; // [esp+14h] [ebp-18h] cSimpleDListIter iter; // [esp+18h] [ebp-14h] BYREF cSimpleDList *pSubscribedList; // [esp+20h] [ebp-Ch] BYREF int found; // [esp+24h] [ebp-8h] @@ -249026,9 +248889,9 @@ int __stdcall cQuestData::UnsubscribeMsg(cQuestData *this, int objID, const char iter.NextNode = NextNode; while ( !cSimpleDListIter::Done(&iter) ) { - v11 = (int)*cSimpleDListIter::Value(&iter); + v11 = *cSimpleDListIter::Value(&iter); v9 = pName; - v7 = cAnsiStr::operator char const *((cAnsiStr *)(v11 + 4)); + v7 = cAnsiStr::operator char const *(&v11->m_pName); if ( !strcmp(v7, v9) ) { v8 = cSimpleDListIter::Node(&iter); @@ -249152,7 +249015,7 @@ int __stdcall cQuestData::Save(cQuestData *this, int (__cdecl *moveFunc)(void *, { const char *v3; // eax char *v4; // eax - int v6; // [esp-4h] [ebp-18h] + unsigned int v6; // [esp-4h] [ebp-18h] int len; // [esp+0h] [ebp-14h] BYREF tHashSetHandle handle; // [esp+4h] [ebp-10h] BYREF cQuestDataNode *pNode; // [esp+10h] [ebp-4h] @@ -249453,7 +249316,7 @@ int __stdcall cQuestData::Init(cQuestData *this) cAutoIPtr pObjectSystem; // [esp+18h] [ebp-Ch] BYREF sObjListenerDesc objListenerDesc; // [esp+1Ch] [ebp-8h] BYREF - objListenerDesc.func = cQuestData::ObjListener; + objListenerDesc.func = (void (__cdecl *)(int, unsigned int, void *))cQuestData::ObjListener; objListenerDesc.data = 0; Aggregated = (IObjectSystem *)_AppGetAggregated(&IID_IObjectSystem); cAutoIPtr::cAutoIPtr(&pObjectSystem, Aggregated); @@ -251594,7 +251457,7 @@ void RendererPalChange() //----- (004CC4B7) -------------------------------------------------------- grs_bitmap *__cdecl texture_lookup(int n) { - bool ok; // [esp+0h] [ebp-4h] + unsigned __int8 ok; // [esp+0h] [ebp-4h] ok = 0; if ( n >= 0 ) @@ -252015,7 +251878,7 @@ void __cdecl cam_render_scene(Position *pos, long double zoom) int bank; // [esp+1Ch] [ebp-14h] const sRGBA *color; // [esp+20h] [ebp-10h] int cell; // [esp+24h] [ebp-Ch] - unsigned __int8 rgb[3]; // [esp+28h] [ebp-8h] BYREF + unsigned __int8 rgb[4]; // [esp+28h] [ebp-8h] BYREF float alpha; // [esp+2Ch] [ebp-4h] BYREF if ( rendloop_clear ) @@ -252094,10 +251957,9 @@ void __cdecl cam_render_scene(Position *pos, long double zoom) } // 4155AA: using guessed type int j__rendobj_finish_object_rendering(void); // 419B50: using guessed type int j__rendobj_init_frame(void); -// 4CD4E0: using guessed type unsigned __int8 pB[2]; //----- (004CD76F) -------------------------------------------------------- -void __cdecl Flash(float alpha, int flash_rgb) +void __cdecl Flash(float alpha, unsigned int flash_rgb) { if ( alpha > 0.0 ) { @@ -252253,7 +252115,7 @@ int __stdcall LoopFunc_5(void *data, int msg, tLoopMessageData__ *hdata) // 4262D8: using guessed type int j__MissionPalSet(void); //----- (004CDB86) -------------------------------------------------------- -void __cdecl do_stats(int time, int overhead, int blit_overhead) +void __cdecl do_stats(unsigned int time, unsigned int overhead, unsigned int blit_overhead) { frame_time = time; if ( show_stats ) @@ -252982,7 +252844,7 @@ double __cdecl ComputeSkyPointVec(mxs_vector *pVec, float fLatAng, float fLongAn float fCosTheta; // [esp+28h] [ebp-8h] float fVal; // [esp+2Ch] [ebp-4h] - *(_QWORD *)&Vec.x = 0i64; + *(_QWORD *)&Vec.x = 0LL; Vec.z = 1.0; v3 = mx_rad2ang(fLatAng); mx_rot_y_vec(pVec, &Vec, v3); @@ -253016,7 +252878,7 @@ void __cdecl ComputeSkyPointColor(mxs_vector *pSkyPointColor, float fLatAng, flo mxs_vector Temp; // [esp+38h] [ebp-18h] BYREF mxs_vector DirVec; // [esp+44h] [ebp-Ch] BYREF - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; for ( i = 0; i < 5 && ControlPointLats[i] + 0.0001 <= fLatAng; ++i ) ; @@ -253225,11 +253087,11 @@ void __thiscall cSky::Render(cSky *this) lgd3d_disable_palette(); lgd3d_set_blend(0); nOldSpace = r3_get_space(); - r3_set_space(0); + r3_set_space(R3_CLIPPING_SPACE); OldPos = *r3_get_view_pos(); r3_set_view(&ZeroPos); r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(25); grd_canvas->gc.fill_type = 0; r3_set_prim(); @@ -253239,7 +253101,7 @@ void __thiscall cSky::Render(cSky *this) lgd3d_set_fog_enable(1); else lgd3d_set_fog_enable(0); - r3_set_polygon_context(512); + r3_set_polygon_context(0x200u); r3_set_color((int)&brush_faces[2048][13].d + 7); r3_transform_block(nTotalPoints, (_r3s_point *)pSkyPoints, pSkyPointVecs); PolyPoints[0] = *vlist; @@ -253362,6 +253224,7 @@ void __stdcall DumpStats(IDebugMalloc *this) nTotalMemory = f_msize(pSkyLats) + v4; mprintf("There %d sky points using %g kbytes\n", nTotalPoints, (double)nTotalMemory / 1024.0); } +// 4D01A3: inconsistent function type and number of purged bytes //----- (004D0232) -------------------------------------------------------- void SkyInstallCommands() @@ -253687,18 +253550,18 @@ void __thiscall cStars::Render(cStars *this) { int bRestoreZCompare; // [esp+8h] [ebp-Ch] int bRestoreZWrite; // [esp+Ch] [ebp-8h] - unsigned int nOldSpace; // [esp+10h] [ebp-4h] + r3e_space nOldSpace; // [esp+10h] [ebp-4h] if ( g_lgd3d && bDidGameInit_0 ) { if ( bSpinStars ) CalcStarData(); nOldSpace = r3_get_space(); - r3_set_space(0); - r3_set_clipmode(0); + r3_set_space(R3_CLIPPING_SPACE); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(6); grd_canvas->gc.fill_type = 3; - r3_set_polygon_context(0x20000); + r3_set_polygon_context(0x20000u); r3_set_prim(); lgd3d_set_blend(1); if ( g_tmgr ) @@ -254036,7 +253899,7 @@ void __thiscall cCelestialObject::Init(cCelestialObject *this) float fDist; // [esp+C4h] [ebp-8h] IResMan *pResMan; // [esp+C8h] [ebp-4h] - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; if ( this->pCelestialObj ) { @@ -254188,10 +254051,10 @@ void __thiscall cCelestialObject::Render(cCelestialObject *this) nStride = r3d_glob.cur_stride; r3d_glob.cur_stride = 160; nOldSpace = r3_get_space(); - r3_set_space(0); + r3_set_space(R3_CLIPPING_SPACE); OldPos = *r3_get_view_pos(); r3_set_view(&ZeroPos); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(31); if ( this->pCelestialObj->bIsAlphaTexture ) { @@ -254206,7 +254069,7 @@ void __thiscall cCelestialObject::Render(cCelestialObject *this) pBitmap->flags = flags; } r3_set_prim(); - r3_set_polygon_context(131584); + r3_set_polygon_context(0x20200u); lgd3d_set_blend(1); r3_set_color((int)&brush_faces[2048][13].d + 7); bRestoreZWrite = lgd3d_is_zwrite_on(); @@ -254408,7 +254271,7 @@ int SetDefaults_1() g_DistantObj.Texture1Name[0] = 0; g_DistantObj.Texture2Name[0] = 0; result = 1065353216; - *(_QWORD *)&g_DistantObj.Color.el[1] = 0x3F8000003F800000i64; + *(_QWORD *)&g_DistantObj.Color.el[1] = 0x3F8000003F800000LL; g_DistantObj.Color.x = 1.0; g_DistantObj.fDistance = 1000.0; g_DistantObj.fTopLatAngle = 80.0; @@ -254438,7 +254301,7 @@ void __thiscall cDistantArt::Init(cDistantArt *this) IRes *pPalRes; // [esp+BCh] [ebp-8h] IResMan *pResMan; // [esp+C0h] [ebp-4h] - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; if ( g_DistantObj.bUseDistantArt ) { @@ -254629,11 +254492,11 @@ void __thiscall cDistantArt::Render(cDistantArt *this) lgd3d_disable_palette(); lgd3d_set_blend(1); nOldSpace = r3_get_space(); - r3_set_space(0); + r3_set_space(R3_CLIPPING_SPACE); OldPos = *r3_get_view_pos(); r3_set_view(&ZeroPos); r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(31); grd_canvas->gc.fill_type = 0; r3_set_prim(); @@ -254643,7 +254506,7 @@ void __thiscall cDistantArt::Render(cDistantArt *this) lgd3d_set_fog_enable(1); else lgd3d_set_fog_enable(0); - r3_set_polygon_context(131584); + r3_set_polygon_context(0x20200u); r3_set_color((int)&brush_faces[2048][13].d + 7); r3_transform_block(nTotalPoints_0, (_r3s_point *)pPoints, pPointVecs); r3_set_texture(pBitmap1); @@ -255333,7 +255196,7 @@ void ComputeGrid() float fGlowTileSize; // [esp+C8h] [ebp-8h] float fGlowMin; // [esp+CCh] [ebp-4h] - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; nPointsPerSide = g_CloudObj.nNumSubTiles * g_CloudObj.nNumTilesPerSide + 1; nTotalPoints_1 = nPointsPerSide * (g_CloudObj.nNumSubTiles * g_CloudObj.nNumTilesPerSide + 1); @@ -255522,11 +255385,11 @@ void __cdecl ComputePointColor(mxs_vector *pPoint, mxs_vector *pPointColor) mxs_vector InterpolateVecs[4]; // [esp+B8h] [ebp-34h] float fMaxInterpolatedScale; // [esp+E8h] [ebp-4h] - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; - *(_QWORD *)&BaseEastVec.x = 1065353216i64; + *(_QWORD *)&BaseEastVec.x = 1065353216LL; BaseEastVec.z = 0.0; - *(_QWORD *)&BaseWestVec.x = 3212836864i64; + *(_QWORD *)&BaseWestVec.x = 3212836864LL; BaseWestVec.z = 0.0; fMaxInterpolatedScale = 0.0; mx_norm_vec(&NormVec, pPoint); @@ -255893,6 +255756,7 @@ void __stdcall DumpStats_0(IDebugMalloc *this) nTotalGlowPoints, (double)nTotalSize / 1024.0); } +// 4D7BDF: inconsistent function type and number of purged bytes //----- (004D7D31) -------------------------------------------------------- void __thiscall cCloudDeck::Render(cCloudDeck *this) @@ -255945,10 +255809,10 @@ void __thiscall cCloudDeck::Render(cCloudDeck *this) nStride = r3d_glob.cur_stride; r3d_glob.cur_stride = 160; nOldSpace = r3_get_space(); - r3_set_space(0); + r3_set_space(R3_CLIPPING_SPACE); OldPos = *r3_get_view_pos(); r3_set_view(&ZeroPos); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(63); if ( g_CloudObj.bIsAlphaTexture ) { @@ -255961,7 +255825,7 @@ void __thiscall cCloudDeck::Render(cCloudDeck *this) pBitmap->align = nPalIx; } r3_set_prim(); - r3_set_polygon_context(131840); + r3_set_polygon_context(0x20300u); lgd3d_set_blend(1); r3_set_color((int)&brush_faces[2048][13].d + 7); bRestoreZWrite = lgd3d_is_zwrite_on(); @@ -256376,9 +256240,9 @@ void __cdecl render_wedge(unsigned __int8 color, unsigned __int8 *clut) int j; // [esp+60h] [ebp-8h] int i; // [esp+64h] [ebp-4h] - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_start_block(); - r3_set_polygon_context((int)&brush_faces[2048][14]); + r3_set_polygon_context((unsigned int)&brush_faces[2048][14]); for ( i = 0; i < 6; ++i ) { for ( j = 0; j < 3; ++j ) @@ -256439,7 +256303,7 @@ void __cdecl rendobj_draw_creature_joints(int obj) num_joints = 32; if ( j__RendCreatureGetJointInfo(obj, pos, &num_joints) ) { - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); r3_start_block(); r3_transform_block(num_joints, pts, pos); @@ -256470,7 +256334,7 @@ void __cdecl draw_bbox(mxs_vector *loc, mxs_angvec *fac, mxs_vector *bmin, mxs_v if ( loc && fac ) r3_start_object_angles(loc, fac, 6); r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); vec[6].x = bmin->x; vec[4].x = vec[6].x; @@ -256519,7 +256383,7 @@ void __cdecl draw_line(mxs_vector *start, mxs_vector *end) mxs_vector vec[2]; // [esp+4h] [ebp-18h] BYREF r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); vec[0] = *start; vec[1] = *end; @@ -256539,7 +256403,7 @@ void __cdecl draw_poly(int n, mxs_vector *vert) if ( n <= 64 ) { r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); r3_transform_block(n, results, vert); for ( i = 0; i < n; ++i ) @@ -256611,7 +256475,7 @@ void __cdecl GetObjScreenBounds(int obj, int *mn, int *mx, bounds bound) if ( startObj == 1 ) r3_start_object_angles(&pos->loc.vec, &pos->fac, 6); r3_start_block(); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); saveflags = r3d_state.cur_con->clip.clip_flags; r3_set_clip_flags(0); vec[6].x = bmin.x; @@ -256800,7 +256664,7 @@ int cam_pop_clip_planes() //----- (004DAF6F) -------------------------------------------------------- void __cdecl draw_clipped_poly(clipped_poly *hp, int tmap_mode) { - int mode; // [esp+0h] [ebp-108h] + unsigned int mode; // [esp+0h] [ebp-108h] _r3s_point *vlist[64]; // [esp+4h] [ebp-104h] BYREF int i; // [esp+104h] [ebp-4h] @@ -257023,7 +256887,7 @@ void __cdecl render_pgon(mds_pgon *p, _r3s_point **vlist, grs_bitmap *bm, unsign //----- (004DB5D6) -------------------------------------------------------- void __cdecl editor_safe_pgon_callback(mds_pgon *p, _r3s_point **vlist, grs_bitmap *bm, unsigned int color, char type) { - int context; // [esp+0h] [ebp-4h] + unsigned int context; // [esp+0h] [ebp-4h] context = 0; if ( (type & 0x18) != 0 ) @@ -257125,13 +256989,13 @@ void __cdecl queue_render_md(void *q, unsigned __int8 *clut) j__cam_push_clip_planes(*((_DWORD *)q + 6), 1); if ( *((_BYTE *)q + 28) == 1 ) { - r3_set_clipmode(2); + r3_set_clipmode(R3_USER_CLIP); for ( i = 0; i < m->verts; ++i ) buf[i].ccodes = 0; } else { - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); } mdd_tmap_mode = *(_DWORD *)q; if ( clut ) @@ -257185,7 +257049,7 @@ void __cdecl editor_safe_render_pgon(mds_pgon *p) int ic; // [esp+24h] [ebp-10h] int id; // [esp+24h] [ebp-10h] char type; // [esp+28h] [ebp-Ch] - int flag; // [esp+2Ch] [ebp-8h] + unsigned int flag; // [esp+2Ch] [ebp-8h] float alpha; // [esp+30h] [ebp-4h] flag = 0; @@ -257469,7 +257333,7 @@ void __cdecl leave_mesh() int __cdecl queue_store_mesh(int idx) { void (__cdecl *old)(_mms_pgon *, int); // [esp+0h] [ebp-14h] - int bufsize; // [esp+4h] [ebp-10h] + unsigned int bufsize; // [esp+4h] [ebp-10h] queued_model_info *qm; // [esp+8h] [ebp-Ch] _mms_model *m; // [esp+Ch] [ebp-8h] int rv; // [esp+10h] [ebp-4h] @@ -257568,7 +257432,7 @@ int __cdecl render_mesh(int idx, int obj, int fragment, int color, unsigned __in render_default(idx, obj, fragment, color, clut); finish_default(); } - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); m = (_mms_model *)j__objmodelGetModel(idx); if ( m ) { @@ -257746,7 +257610,7 @@ int __cdecl render_sparks(int idx, int obj) //----- (004DCAE0) -------------------------------------------------------- int __cdecl render_particle(int idx, int obj, int fragment, int color, unsigned __int8 *clut) { - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); if ( clut ) start_generic_clut(clut); j__ParticleGroupRender(obj); @@ -257797,9 +257661,9 @@ void __cdecl RenderBitmapGeneric(Position *pos, int idx, int frame, mxs_vector * grs_bitmap *bm; // [esp+D8h] [ebp-4h] bm = j__objmodelSetupBitmapTexture(idx, frame); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_start_block(); - r3_set_polygon_context(0x20000); + r3_set_polygon_context(0x20000u); r3_set_texture(bm); r3_set_prim(); r3_transform_block(1, pt, &pos->loc.vec); @@ -257877,9 +257741,9 @@ void __cdecl RenderBitmapWorldspace( fXTilesPerObject = pBWS->m_fXSize / pBWS->m_fXFeetPerTile; fYTilesPerObject = pBWS->m_fYSize / pBWS->m_fYFeetPerTile; bm = j__objmodelSetupBitmapTexture(idx, frame); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_start_block(); - r3_set_polygon_context(0x20000); + r3_set_polygon_context(0x20000u); r3_set_texture(bm); r3_set_prim(); mx_ang2mat(&orient, &pos->fac); @@ -258067,12 +257931,12 @@ BOOL __cdecl rendobj_object_is_visible(int obj) //----- (004DD3DD) -------------------------------------------------------- void __cdecl rendobj_nonship_aftereffects(int obj) { - int v1; // [esp+0h] [ebp-84h] - int v2; // [esp+4h] [ebp-80h] - int v3; // [esp+8h] [ebp-7Ch] - int v4; // [esp+Ch] [ebp-78h] - int v5; // [esp+10h] [ebp-74h] - int v6; // [esp+14h] [ebp-70h] + BOOL v1; // [esp+0h] [ebp-84h] + BOOL v2; // [esp+4h] [ebp-80h] + BOOL v3; // [esp+8h] [ebp-7Ch] + BOOL v4; // [esp+Ch] [ebp-78h] + BOOL v5; // [esp+10h] [ebp-74h] + BOOL v6; // [esp+14h] [ebp-70h] _r3s_point pt[2]; // [esp+18h] [ebp-6Ch] BYREF mxs_vector *vec; // [esp+70h] [ebp-14h] mxs_vector newpt; // [esp+74h] [ebp-10h] BYREF @@ -258231,7 +258095,7 @@ void __cdecl rendobj_draw_phys_models(int obj) grd_canvas->gc.fcolor = 254; if ( j__RendPhysGetSphereModelInfo(obj, pos, size, &numModels) ) { - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); r3_start_block(); r3_transform_block(numModels, pts, pos); @@ -258262,7 +258126,7 @@ void __cdecl rendobj_draw_phys_models(int obj) mx_normeq_vec(&forces); mx_scaleeq_vec(&forces, 2.0); mx_addeq_vec(&forces, &position); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); r3_transform_block(1, &from, &position); r3_transform_block(1, &to_vel, &velocity); @@ -258275,7 +258139,7 @@ void __cdecl rendobj_draw_phys_models(int obj) for ( i = 0; i < num_constraints; ++i ) { mx_addeq_vec(&constraints[i], &position); - r3_set_clipmode(0); + r3_set_clipmode(R3_CLIP); r3_set_clip_flags(0); r3_transform_block(1, &to, &constraints[i]); r3_draw_line(&from, &to); @@ -258858,7 +258722,7 @@ IObjIDSink *__thiscall cIPtr::operator IObjIDSink *(cIPtr::ZeroBounds() { - return 0i64; + return 0LL; } //----- (004DFFB0) -------------------------------------------------------- @@ -258878,13 +258742,13 @@ void __thiscall cObjArray::AutoConnect(cObjArray *v9; // [esp+10h] [ebp-10h] - char v10[8]; // [esp+14h] [ebp-Ch] BYREF + _BYTE v10[8]; // [esp+14h] [ebp-Ch] BYREF cAutoIPtr pObjIDManager; // [esp+1Ch] [ebp-4h] BYREF Aggregated = (IObjIDManager *)_AppGetAggregated(&IID_IObjIDManager); cAutoIPtr::cAutoIPtr(&pObjIDManager, Aggregated); v7 = cIPtr::operator->(&pObjIDManager); - v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, char *))v7->GetObjIDBounds)(v7, v10); + v2 = (const sObjBounds *)((int (__thiscall *)(IObjIDManager *, _BYTE *))v7->GetObjIDBounds)(v7, v10); cObjArray::Resize(this, v2); v9 = (cArrayObjIDSink *)j__new(0xCu, aRPrjThief2Skup_557, 241); if ( v9 ) @@ -258903,7 +258767,6 @@ void __thiscall cObjArray::AutoConnect(cObjArray::~cAutoIPtr(&pObjIDManager); } // 4E0051: variable 'v3' is possibly undefined -// 4DFFE0: using guessed type char var_C[8]; //----- (004E00C0) -------------------------------------------------------- void __thiscall cObjArray::AutoDisconnect(cObjArray *this) @@ -259456,7 +259319,7 @@ void __cdecl UpdateObjBrush(int obj) memset(&Scale, 0, sizeof(Scale)); j__editobjUpdateBrushFromObjScale(obj, &Scale); - *(_QWORD *)&Scale.x = 0x3F8000003F800000i64; + *(_QWORD *)&Scale.x = 0x3F8000003F800000LL; Scale.z = 1.0; j__editobjUpdateBrushFromObjScale(obj, &Scale); } @@ -260823,7 +260686,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -260837,7 +260700,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4E3040: using guessed type char var_8[4]; //----- (004E30F0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -260875,7 +260737,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -260890,7 +260752,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cBitmapWorldspaceOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cBitmapWorldspaceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -260898,7 +260760,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4E31A0: using guessed type char var_C[4]; //----- (004E3280) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -260909,7 +260770,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -260918,7 +260779,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cBitmapWorldspaceOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cBitmapWorldspaceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -260933,7 +260794,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4E3310: variable 'v5' is possibly undefined -// 4E3280: using guessed type char var_C[4]; //----- (004E3350) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -261022,7 +260882,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -261034,7 +260894,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4E3570: using guessed type char var_C[4]; //----- (004E3600) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -261064,7 +260923,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -261074,7 +260933,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cBitmapWorldspaceOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4E3660: using guessed type char var_8[4]; //----- (004E36F0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -261168,7 +261026,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -261190,7 +261048,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 4E3890: using guessed type char var_18[4]; //----- (004E3950) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -261247,7 +261104,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -261267,7 +261124,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cJointPosOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cJointPosOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -261278,7 +261135,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 4E3A70: using guessed type char var_1C[4]; //----- (004E3B60) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -261292,7 +261148,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -261301,7 +261157,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cJointPosOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cJointPosOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -261320,7 +261176,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 4E3BFA: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 4E3B60: using guessed type char var_14[4]; //----- (004E3C40) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -261411,7 +261266,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -261423,7 +261278,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4E3EB0: using guessed type char var_C[4]; //----- (004E3F40) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -261447,7 +261301,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore //----- (004E3FA0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -261457,7 +261311,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore ((void (__stdcall *)(cJointPosOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4E3FA0: using guessed type char var_8[4]; //----- (004E4030) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -261757,7 +261610,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -261785,7 +261638,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4E478C: variable 'v4' is possibly undefined -// 4E46F0: using guessed type char var_10[4]; //----- (004E47F0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -262099,7 +261951,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -262127,7 +261979,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4E50EC: variable 'v4' is possibly undefined -// 4E5050: using guessed type char var_10[4]; //----- (004E5150) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -262427,19 +262278,19 @@ int __stdcall InitFunc(IUnknown *goof) IResMan *pResMan; // [esp+1F0h] [ebp-4h] ResAddPath(::path); - if ( config_get_raw(aDataPath, path, 256) ) + if ( config_get_raw(aDataPath, path, 0x100u) ) ResAddPath(path); else path[0] = 0; if ( config_get_single_value(aMemCap, 1, (void **)&mem) ) ResMemSetCap(mem << 20); pResMan = (IResMan *)_AppGetAggregated(&IID_IResMan); - if ( config_get_raw(aLanguage_1, path, 256) ) + if ( config_get_raw(aLanguage_1, path, 0x100u) ) { extra[0] = byte_B962F8; memset(&extra[1], 0, 79); vpath = 0; - config_get_raw(aVariantPath, extra, 80); + config_get_raw(aVariantPath, extra, 0x50u); sprintf(buf, "%s;%s;.", path, extra); vpath = pResMan->NewSearchPath(pResMan, buf); ((void (__thiscall *)(IResMan *, IResMan *, ISearchPath *))pResMan->SetDefaultVariants)(pResMan, pResMan, vpath); @@ -262453,13 +262304,13 @@ int __stdcall InitFunc(IUnknown *goof) &unk_B962FC); strcpy(install, "."); memset(&install[2], 0, 78); - config_get_raw(aInstallPath, install, 80); + config_get_raw(aInstallPath, install, 0x50u); sprintf(path, "%s\\patch", install); gContextPath->AddPath(gContextPath, path); gContextPath->AddPath(gContextPath, asc_9D1780); if ( path[0] ) ((void (__thiscall *)(ISearchPath *, ISearchPath *, char *))gContextPath->AddPath)(gContextPath, gContextPath, path); - if ( config_get_raw(aResnameBase_3, path, 256) ) + if ( config_get_raw(aResnameBase_3, path, 0x100u) ) ((void (__thiscall *)(ISearchPath *, ISearchPath *, char *))gContextPath->AddPath)(gContextPath, gContextPath, path); ((void (__thiscall *)(IResMan *, IResMan *, ISearchPath *))pResMan->SetGlobalContext)(pResMan, pResMan, gContextPath); pResMan->SetDefaultPath(pResMan, gContextPath); @@ -262788,7 +262639,7 @@ void __cdecl startFlashbombRender(int obj, float intensity) double __cdecl compute_flashbomb_effects(unsigned __int8 *rgb) { float intensity; // [esp+0h] [ebp-28h] - unsigned __int8 color[3]; // [esp+4h] [ebp-24h] BYREF + unsigned __int8 color[4]; // [esp+4h] [ebp-24h] BYREF int obj; // [esp+8h] [ebp-20h] BYREF sPropertyObjIter iter; // [esp+Ch] [ebp-1Ch] BYREF float alpha; // [esp+20h] [ebp-8h] @@ -263323,7 +263174,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -263333,7 +263184,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 4E7370: using guessed type char var_10[4]; //----- (004E73E0) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -263373,7 +263223,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -263386,13 +263236,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cRendFlashOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 4E74D0: using guessed type char var_10[4]; //----- (004E7580) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -263404,7 +263253,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -263424,7 +263273,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cRendFlashOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cRendFlashOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -263440,7 +263289,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 4E7580: using guessed type char var_18[4]; //----- (004E7690) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -263533,7 +263381,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -263545,7 +263393,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4E7870: using guessed type char var_C[4]; //----- (004E7900) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -263569,7 +263416,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -263579,7 +263426,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4E7960: using guessed type char var_8[4]; //----- (004E79F0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -263791,7 +263637,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -263819,7 +263665,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4E7F7C: variable 'v4' is possibly undefined -// 4E7EE0: using guessed type char var_10[4]; //----- (004E7FE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -264463,7 +264308,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -264477,7 +264322,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4E8F00: using guessed type char var_8[4]; //----- (004E8FB0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -264507,7 +264351,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore * //----- (004E9060) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -264522,7 +264366,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * } else { - setval.value = *(void **)((int (__stdcall *)(cScaleOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cScaleOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -264530,7 +264374,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore * cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 4E9060: using guessed type char var_C[4]; //----- (004E9140) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -264541,7 +264384,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -264550,7 +264393,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cScaleOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cScaleOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -264565,7 +264408,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4E91D0: variable 'v5' is possibly undefined -// 4E9140: using guessed type char var_C[4]; //----- (004E9210) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -264644,7 +264486,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -264656,7 +264498,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4E9430: using guessed type char var_C[4]; //----- (004E94C0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -264680,7 +264521,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *this, //----- (004E9520) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -264690,7 +264531,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *this ((void (__stdcall *)(cScaleOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4E9520: using guessed type char var_8[4]; //----- (004E95B0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -264915,7 +264755,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -264943,7 +264783,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4E9B5C: variable 'v4' is possibly undefined -// 4E9AC0: using guessed type char var_10[4]; //----- (004E9BC0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -268265,7 +268104,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -268279,7 +268118,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4EF4A0: using guessed type char var_8[4]; //----- (004EF550) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -268309,7 +268147,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -268324,7 +268162,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cSchemaPlayOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -268332,7 +268170,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 4EF600: using guessed type char var_C[4]; //----- (004EF6E0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -268343,7 +268180,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -268352,7 +268189,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cSchemaPlayOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cSchemaPlayOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -268367,7 +268204,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4EF770: variable 'v5' is possibly undefined -// 4EF6E0: using guessed type char var_C[4]; //----- (004EF7B0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -268453,7 +268289,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -268465,7 +268301,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4EF9D0: using guessed type char var_C[4]; //----- (004EFA60) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -268489,7 +268324,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -268499,7 +268334,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4EFAC0: using guessed type char var_8[4]; //----- (004EFB50) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -268588,7 +268422,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -268602,7 +268436,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 4EFCF0: using guessed type char var_8[4]; //----- (004EFDA0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -268632,7 +268465,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -268647,7 +268480,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cSchLoopOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -268655,7 +268488,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 4EFE50: using guessed type char var_C[4]; //----- (004EFF30) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -268666,7 +268498,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -268675,7 +268507,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cSchLoopOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cSchLoopOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -268690,7 +268522,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 4EFFC0: variable 'v5' is possibly undefined -// 4EFF30: using guessed type char var_C[4]; //----- (004F0000) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -268773,7 +268604,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -268785,7 +268616,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4F0220: using guessed type char var_C[4]; //----- (004F02B0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -268809,7 +268639,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (004F0310) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -268819,7 +268649,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cSchLoopOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4F0310: using guessed type char var_8[4]; //----- (004F03A0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -269101,7 +268930,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -269129,7 +268958,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4F0B1C: variable 'v4' is possibly undefined -// 4F0A80: using guessed type char var_10[4]; //----- (004F0B80) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -269250,7 +269078,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -269278,7 +269106,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4F0E5C: variable 'v4' is possibly undefined -// 4F0DC0: using guessed type char var_10[4]; //----- (004F0EC0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -269814,7 +269641,6 @@ void __cdecl SchemaSamplesRead(ITagFile *pFile) } } // 4F1A8F: variable 'v1' is possibly undefined -// 4F1A13: using guessed type unsigned __int8 freq[4]; //----- (004F1B4D) -------------------------------------------------------- int __cdecl SchemaSamplesOpenForReading(ITagFile *pFile) @@ -270527,7 +270353,7 @@ int __stdcall ScrnManLoopFunc(_ScrnManContext *context, int msg, tLoopMessageDat last_resort = v7; if ( !v7 ) { - config_get_raw(aScrnLoopFailMs, buf, 80); + config_get_raw(aScrnLoopFailMs, buf, 0x50u); MessageBoxA(0, buf, 0, 0x30u); exit(0); } @@ -271103,7 +270929,7 @@ int ScrnClear() grs_canvas *ScrnBlacken() { grs_canvas *result; // eax - int have_canv; // [esp+0h] [ebp-8h] + BOOL have_canv; // [esp+0h] [ebp-8h] IDisplayDevice *pDisp; // [esp+4h] [ebp-4h] have_canv = grd_visible_canvas != 0; @@ -271244,7 +271070,7 @@ grs_canvas *__cdecl ScrnGetDrawCanvas() //----- (004F46A9) -------------------------------------------------------- void __cdecl ScrnNewPalette(unsigned __int8 *pal, unsigned int start, int size) { - if ( start > 0xFF || (int)(size + start) > 256 || size < 0 ) + if ( start >= 0x100 || (int)(size + start) > 256 || size < 0 ) DbgReportWarning("ScrnNewPalette: start is %d and size is %d, illegal\n", start, size); build_palette(pal); j__ScrnUsePalette(); @@ -271269,7 +271095,7 @@ int ScrnNewBlackPalette() //----- (004F4756) -------------------------------------------------------- void __cdecl ScrnLoadPalette(unsigned __int8 *pal, unsigned int start, int size) { - if ( start > 0xFF || (int)(size + start) > 256 || size < 0 ) + if ( start >= 0x100 || (int)(size + start) > 256 || size < 0 ) DbgReportWarning("ScrnLoadPalette: start is %d and size is %d, illegal\n", start, size); build_palette(pal); } @@ -271460,8 +271286,8 @@ BOOL __cdecl ScrnSetModeRaw(const sScrnMode *mode) lgd3ds_device_info *device_info; // eax int v2; // eax int v4; // [esp+0h] [ebp-48h] - int v5; // [esp+0h] [ebp-48h] - int v6; // [esp+4h] [ebp-44h] + BOOL v5; // [esp+0h] [ebp-48h] + BOOL v6; // [esp+4h] [ebp-44h] int v7; // [esp+8h] [ebp-40h] int v8; // [esp+Ch] [ebp-3Ch] int idx; // [esp+10h] [ebp-38h] BYREF @@ -271794,7 +271620,7 @@ void ScreenOverlaysInit() strcpy(cfg_strs[1], aNone_13); memset(cfg_vals, 0, sizeof(cfg_vals)); sprintf(cfg_name, "interface_%d", i); - if ( config_get_raw(cfg_name, fname, 39) ) + if ( config_get_raw(cfg_name, fname, 0x27u) ) { sscanf(fname, "%s %s", cfg_strs, cfg_strs[1]); sprintf(cfg_name, "interface_pos_%d", i); @@ -272151,7 +271977,7 @@ void trace_dump() IScriptMan *v1; // [esp+0h] [ebp-1Ch] IScriptMan *v2; // [esp+4h] [ebp-18h] IScriptMan *v3; // [esp+8h] [ebp-14h] - cScrTrace *pTrace; // [esp+Ch] [ebp-10h] + const cScrTrace *pTrace; // [esp+Ch] [ebp-10h] tScrIter__ *i; // [esp+10h] [ebp-Ch] BYREF cAutoIPtr pScriptMan; // [esp+14h] [ebp-8h] BYREF int iMask; // [esp+18h] [ebp-4h] @@ -272162,7 +271988,7 @@ void trace_dump() v3 = cIPtr::operator->(&pScriptMan); iMask = v3->GetTraceLineMask(v3); v2 = cIPtr::operator->(&pScriptMan); - for ( pTrace = (cScrTrace *)v2->GetFirstTrace(v2, &i); pTrace; pTrace = (cScrTrace *)v1->GetNextTrace(v1, &i) ) + for ( pTrace = v2->GetFirstTrace(v2, &i); pTrace; pTrace = v1->GetNextTrace(v1, &i) ) { dump_one_trace(pTrace, iMask); v1 = cIPtr::operator->(&pScriptMan); @@ -272171,7 +271997,7 @@ void trace_dump() } //----- (004F6B85) -------------------------------------------------------- -void __cdecl dump_one_trace(cScrTrace *pTrace, int iMask) +void __cdecl dump_one_trace(const cScrTrace *pTrace, int iMask) { IEditTools *Aggregated; // eax IEditTools *v3; // eax @@ -272238,7 +272064,7 @@ void trace_dump_active() IScriptMan *v1; // [esp+0h] [ebp-1Ch] IScriptMan *v2; // [esp+4h] [ebp-18h] IScriptMan *v3; // [esp+8h] [ebp-14h] - cScrTrace *pTrace; // [esp+Ch] [ebp-10h] + const cScrTrace *pTrace; // [esp+Ch] [ebp-10h] tScrIter__ *i; // [esp+10h] [ebp-Ch] BYREF cAutoIPtr pScriptMan; // [esp+14h] [ebp-8h] BYREF int iMask; // [esp+18h] [ebp-4h] @@ -272249,7 +272075,7 @@ void trace_dump_active() v3 = cIPtr::operator->(&pScriptMan); iMask = v3->GetTraceLineMask(v3); v2 = cIPtr::operator->(&pScriptMan); - for ( pTrace = (cScrTrace *)v2->GetFirstTrace(v2, &i); pTrace; pTrace = (cScrTrace *)v1->GetNextTrace(v1, &i) ) + for ( pTrace = v2->GetFirstTrace(v2, &i); pTrace; pTrace = v1->GetNextTrace(v1, &i) ) { if ( ((1 << pTrace->m_iTraceLine) & iMask) != 0 ) dump_one_trace(pTrace, iMask); @@ -272656,7 +272482,7 @@ char *__cdecl get_real_fname(char *str) void __cdecl prune_path(char *str) { int search; // [esp+0h] [ebp-Ch] - int length; // [esp+4h] [ebp-8h] + size_t length; // [esp+4h] [ebp-8h] char *s; // [esp+8h] [ebp-4h] length = strlen(str); @@ -272754,7 +272580,7 @@ void CreateScriptProp() j__InitScriptReactions(); pathbuf[0] = byte_B967EC; memset(&pathbuf[1], 0, 255); - config_get_raw(aScriptModulePa, pathbuf, 256); + config_get_raw(aScriptModulePa, pathbuf, 0x100u); DatapathAdd(&script_path, pathbuf); Aggregated = (IScriptMan *)_AppGetAggregated(&IID_IScriptMan); cAutoIPtr::cAutoIPtr(&pScriptMan, Aggregated); @@ -273309,7 +273135,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -273331,7 +273157,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 4F8C20: using guessed type char var_18[4]; //----- (004F8CE0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -273388,7 +273213,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -273408,7 +273233,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cScriptOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cScriptOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -273419,7 +273244,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 4F8E00: using guessed type char var_1C[4]; //----- (004F8EF0) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -273433,7 +273257,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -273442,7 +273266,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cScriptOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cScriptOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -273461,7 +273285,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 4F8F8A: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 4F8EF0: using guessed type char var_14[4]; //----- (004F8FD0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -273552,7 +273375,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -273564,7 +273387,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 4F9240: using guessed type char var_C[4]; //----- (004F92D0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -273588,7 +273410,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (004F9330) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -273598,7 +273420,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cScriptOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 4F9330: using guessed type char var_8[4]; //----- (004F93C0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -273928,7 +273749,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -273956,7 +273777,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 4F9C02: variable 'v4' is possibly undefined -// 4F9B60: using guessed type char var_10[4]; //----- (004F9C60) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -274513,7 +274333,7 @@ void __thiscall cSimMan::SendScriptMsg(cSimMan *this, int kind) IObjectQuery *v12; // [esp+10h] [ebp-64h] IObjectSystem *v13; // [esp+14h] [ebp-60h] IScriptMan *v14; // [esp+18h] [ebp-5Ch] - int v15; // [esp+1Ch] [ebp-58h] + BOOL v15; // [esp+1Ch] [ebp-58h] cSimMan *thisa; // [esp+20h] [ebp-54h] sSimMsg msg; // [esp+28h] [ebp-4Ch] BYREF cAutoIPtr query; // [esp+64h] [ebp-10h] BYREF @@ -275341,7 +275161,7 @@ void __cdecl move_sim_time(ITagFile *file) //----- (004FBF9F) -------------------------------------------------------- void __cdecl SlowFrame(unsigned int nMilliseconds) { - int nStart; // [esp+0h] [ebp-4h] + DWORD nStart; // [esp+0h] [ebp-4h] nStart = timeGetTime(); while ( timeGetTime() - nStart < nMilliseconds ) @@ -275393,14 +275213,14 @@ unsigned int __stdcall cSimpleDamageModel::HandleImpact( sDamageMsg::sDamageMsg(&msg, 2u, &msgdata, cause); result = cBaseDamageModel::SendMessage(this, &msg); if ( result > 4 ) - return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); if ( culprit && victim && j__ObjHasWeaponDamage(culprit) ) { kind = 0; damage.amount = j__ObjGetWeaponDamage(culprit); j__ObjGetWeaponType(culprit, &kind); damage.kind = kind; - opinion = this->DamageObject(this, victim, culprit, &damage, &msg, 0); + opinion = this->DamageObject(this, victim, culprit, &damage, (sChainedEvent *)&msg, 0); if ( opinion <= result ) return result; else @@ -275457,7 +275277,7 @@ unsigned int __stdcall cSimpleDamageModel::DamageObject( else v7 = opinion; result = v7; - return cBaseDamageModel::ApplyResult(this, victim, culprit, v7, &msg); + return cBaseDamageModel::ApplyResult(this, victim, culprit, v7, &msg.sChainedEvent); } //----- (004FC43C) -------------------------------------------------------- @@ -275470,7 +275290,7 @@ unsigned int __stdcall cSimpleDamageModel::SlayObject( IObjectNetworking *Aggregated; // eax IObjectNetworking *v6; // [esp+0h] [ebp-50h] unsigned int v7; // [esp+4h] [ebp-4Ch] - const sChainedEvent *v8; // [esp+14h] [ebp-3Ch] + sDamageMsg *v8; // [esp+14h] [ebp-3Ch] int kind; // [esp+18h] [ebp-38h] sDamageMsg msg; // [esp+1Ch] [ebp-34h] BYREF sDamageMsgData msgdata; // [esp+38h] [ebp-18h] BYREF @@ -275490,9 +275310,9 @@ unsigned int __stdcall cSimpleDamageModel::SlayObject( kind = 0; if ( cause ) { - v8 = sChainedEvent::Find(cause, 3u); + v8 = (sDamageMsg *)sChainedEvent::Find(cause, 3u); if ( v8 ) - kind = *(_DWORD *)(v8[2].ev.kind + 4); + kind = *(_DWORD *)(v8->data.slay + 4); } msgdata.kind = 4; msgdata.victim = victim; @@ -275507,7 +275327,7 @@ unsigned int __stdcall cSimpleDamageModel::SlayObject( if ( result <= 4 ) result = 4; else - result = cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg); + result = cBaseDamageModel::ApplyResult(this, victim, culprit, result, &msg.sChainedEvent); v7 = result; cAutoIPtr::~cAutoIPtr(&pObjectNetworking); return v7; @@ -275528,7 +275348,7 @@ unsigned int __stdcall cSimpleDamageModel::TerminateObject(cSimpleDamageModel *t INetManager *v12; // [esp+Ch] [ebp-78h] IObjectNetworking *v13; // [esp+10h] [ebp-74h] sFlinder *pFlinder; // [esp+14h] [ebp-70h] - float scale; // [esp+18h] [ebp-6Ch] BYREF + int scale; // [esp+18h] [ebp-6Ch] BYREF Position pos; // [esp+1Ch] [ebp-68h] BYREF int corpse; // [esp+34h] [ebp-50h] cAutoIPtr pNetManager; // [esp+38h] [ebp-4Ch] BYREF @@ -275579,11 +275399,11 @@ unsigned int __stdcall cSimpleDamageModel::TerminateObject(cSimpleDamageModel *t cSimpleDamageModel::PropagateCulpability(this, victim, corpse, 1u); if ( cCorpseIter::GetData(&corpseIter) ) { - if ( g_pSourceScaleProperty->Get(g_pSourceScaleProperty, victim, &scale) ) - ((void (__stdcall *)(IFloatProperty *, int, _DWORD))g_pSourceScaleProperty->Set)( + if ( g_pSourceScaleProperty->Get(g_pSourceScaleProperty, victim, (float *)&scale) ) + ((void (__stdcall *)(IFloatProperty *, int, int))g_pSourceScaleProperty->Set)( g_pSourceScaleProperty, corpse, - LODWORD(scale)); + scale); } ((void (__thiscall *)(IObjectSystem *, IObjectSystem *, int))this->mpObjSys->EndCreate)( this->mpObjSys, @@ -275610,7 +275430,7 @@ unsigned int __stdcall cSimpleDamageModel::TerminateObject(cSimpleDamageModel *t cAutoIPtr::~cAutoIPtr(&pNetManager); } if ( result > 5 ) - return cBaseDamageModel::ApplyResult(this, victim, 0, result, &msg); + return cBaseDamageModel::ApplyResult(this, victim, 0, result, &msg.sChainedEvent); return result; } @@ -276200,7 +276020,7 @@ int __cdecl GetTxtIdNearAndUnder(const mxs_vector *pos, const Location *old_loc, txt_id = -1; mx_copy_vec(&ray_start, pos); - *(_QWORD *)&delta.x = 0i64; + *(_QWORD *)&delta.x = 0LL; delta.z = -10.0; mx_add_vec(&ray_end, &ray_start, &delta); ray_source.vec = ray_start; @@ -278998,7 +278818,7 @@ void __cdecl SongFilesLoadFromDir(const char *where, char *what, void (__cdecl * cAnsiStr::FmtStr(&resSongPath, ".\\%s", where); v3 = cAnsiStr::operator char const *(&resSongPath); SongFilesGet(v3, what); - if ( config_get_raw(aSongSourcePath, szDataPath, 143) ) + if ( config_get_raw(aSongSourcePath, szDataPath, 0x8Fu) ) { cAnsiStr::FmtStr(&resSongPath, "%s\\%s", szDataPath, where); v4 = cAnsiStr::operator char const *(&resSongPath); @@ -279020,7 +278840,7 @@ void __cdecl SongFilesGet(const char *pszDataPath, char *pszWhat) char *pszFileName; // [esp+60h] [ebp-8h] sSongFile *pSongFile; // [esp+64h] [ebp-4h] - memset(&sDatapath, 0, sizeof(sDatapath)); + memset((void *)&sDatapath, 0, sizeof(sDatapath)); DatapathAdd(&sDatapath, pszDataPath); pDatapathDir = DatapathOpenDir(&sDatapath, pszWhat, 1); while ( 1 ) @@ -279639,9 +279459,9 @@ sMissionSongParams *__thiscall cFileVarm_Concept, pName); cDABase>::InsertAtIndex(&this->m_ConceptPriority, &iPriority, iIndex); @@ -279649,9 +279469,9 @@ int __thiscall cSpeechDomain::AddConcept(cSpeechDomain *this, Label *pName, int } //----- (00504894) -------------------------------------------------------- -int __thiscall cSpeechDomain::AddTag(cSpeechDomain *this, Label *pName, int iFlags) +unsigned int __thiscall cSpeechDomain::AddTag(cSpeechDomain *this, Label *pName, int iFlags) { - int iIndex; // [esp+4h] [ebp-4h] + unsigned int iIndex; // [esp+4h] [ebp-4h] iIndex = cNameMap::AddName(&this->m_Tag, pName); cDABase>::InsertAtIndex(&this->m_TagFlags, &iFlags, iIndex); @@ -280379,7 +280199,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -280393,7 +280213,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 505A80: using guessed type char var_8[4]; //----- (00505B30) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -280423,7 +280242,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore //----- (00505BE0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -280438,7 +280257,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore } else { - setval.value = *(void **)((int (__stdcall *)(cSpeechOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cSpeechOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -280446,7 +280265,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 505BE0: using guessed type char var_C[4]; //----- (00505CC0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -280457,7 +280275,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -280466,7 +280284,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cSpeechOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cSpeechOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -280481,7 +280299,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 505D50: variable 'v5' is possibly undefined -// 505CC0: using guessed type char var_C[4]; //----- (00505D90) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -280562,7 +280379,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -280574,7 +280391,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 505FB0: using guessed type char var_C[4]; //----- (00506040) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -280598,7 +280414,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (005060A0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -280608,7 +280424,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cSpeechOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5060A0: using guessed type char var_8[4]; //----- (00506130) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -280848,7 +280663,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -280876,7 +280691,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 50674C: variable 'v4' is possibly undefined -// 5066B0: using guessed type char var_10[4]; //----- (005067B0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -281003,7 +280817,7 @@ void __thiscall cSpeechVoice::cSpeechVoice(cSpeechVoice *this) { ITagDBDatabase *v1; // esi int i; // [esp+8h] [ebp-8h] - int iNumConcepts; // [esp+Ch] [ebp-4h] + signed int iNumConcepts; // [esp+Ch] [ebp-4h] cDynArray::cDynArray(&this->m_ConceptDatabase); sTagDBData::sTagDBData(&this->m_CurrentData); @@ -281682,7 +281496,7 @@ int __cdecl SpeechSpeak(void *SpeakerObjID, const Label *pConcept, cTagDBInput * const char *v7; // eax int v8; // [esp-4h] [ebp-88h] IEditTools *v9; // [esp+0h] [ebp-84h] - int v10; // [esp+4h] [ebp-80h] + BOOL v10; // [esp+4h] [ebp-80h] int v11; // [esp+8h] [ebp-7Ch] int i; // [esp+18h] [ebp-6Ch] int VoiceObjID; // [esp+1Ch] [ebp-68h] @@ -282867,7 +282681,7 @@ void __cdecl SetVertexBoundingBoxes(PortalCell *cell) { int i; // [esp+0h] [ebp-Ch] mxs_vector *vertex; // [esp+4h] [ebp-8h] - int num_vertices; // [esp+8h] [ebp-4h] + signed int num_vertices; // [esp+8h] [ebp-4h] vertex = cell->vpool; num_vertices = cell->num_vertices; @@ -283106,9 +282920,9 @@ unsigned __int8 __cdecl TestEdgesInPlane(int cell_index, int current_plane_index mxds_vector edge_direction; // [esp+74h] [ebp-138h] BYREF int start; // [esp+8Ch] [ebp-120h] mxds_vector point_in_world; // [esp+90h] [ebp-11Ch] BYREF - long double proj_radius_length; // [esp+A8h] [ebp-104h] + double proj_radius_length; // [esp+A8h] [ebp-104h] mxds_vector end_vertex; // [esp+B0h] [ebp-FCh] BYREF - long double edge_length; // [esp+C8h] [ebp-E4h] + double edge_length; // [esp+C8h] [ebp-E4h] mxds_vector proj_radius; // [esp+D0h] [ebp-DCh] BYREF long double time_along_edge; // [esp+E8h] [ebp-C4h] long double proj_dist_ray_to_contact; // [esp+F0h] [ebp-BCh] @@ -283647,7 +283461,7 @@ void __cdecl FindMatchingVertices(int contact_index) sSphrContactData *contact_data; // [esp+0h] [ebp-1Ch] int contact_data_index; // [esp+4h] [ebp-18h] int next_index; // [esp+8h] [ebp-14h] - int polygon_index; // [esp+10h] [ebp-Ch] + unsigned int polygon_index; // [esp+10h] [ebp-Ch] sSphrContact *contact; // [esp+14h] [ebp-8h] int original_contact_data_index; // [esp+18h] [ebp-4h] @@ -283729,7 +283543,7 @@ unsigned __int8 __cdecl SphrSphereInWorld(Location *center_loc, float radius, un int num_polys; // [esp+10h] [ebp-28h] PortalPolygonCore *polygon; // [esp+14h] [ebp-24h] int num_solid_polys; // [esp+18h] [ebp-20h] - int vertex_offset; // [esp+1Ch] [ebp-1Ch] + unsigned int vertex_offset; // [esp+1Ch] [ebp-1Ch] int center_hint_index; // [esp+20h] [ebp-18h] int j; // [esp+2Ch] [ebp-Ch] int i; // [esp+30h] [ebp-8h] @@ -283771,7 +283585,7 @@ unsigned __int8 __cdecl SphrSphereInWorld(Location *center_loc, float radius, un unsigned __int8 __cdecl PolygonIntersectsSphere( PortalCell *cell, PortalPolygonCore *polygon, - int vertex_offset, + unsigned int vertex_offset, mxs_vector *center, float radius) { @@ -284641,7 +284455,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -284669,7 +284483,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 50E60C: variable 'v4' is possibly undefined -// 50E570: using guessed type char var_10[4]; //----- (0050E670) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -285107,7 +284920,7 @@ void __cdecl StatusField(unsigned int x, char *s) { int cur_sz; // [esp+0h] [ebp-4h] - if ( x >= 9 ) + if ( x > 8 ) DbgReportError(1, "Invalid status field parameter %d\n", x); if ( strcmp(status_string[x], s) ) { @@ -286028,7 +285841,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -286042,7 +285855,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 510B50: using guessed type char var_8[4]; //----- (00510C00) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -286082,7 +285894,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -286100,7 +285912,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -286108,7 +285920,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 510CB0: using guessed type char var_C[4]; //----- (00510D90) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -286119,7 +285930,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -286128,7 +285939,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -286143,7 +285954,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 510E20: variable 'v5' is possibly undefined -// 510D90: using guessed type char var_C[4]; //----- (00510E60) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -286233,7 +286043,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -286248,7 +286058,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 511080: using guessed type char var_C[4]; //----- (00511110) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -286279,7 +286088,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -286289,7 +286098,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 511170: using guessed type char var_8[4]; //----- (00511200) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -286534,7 +286342,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -286562,7 +286370,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 51184C: variable 'v4' is possibly undefined -// 5117B0: using guessed type char var_10[4]; //----- (005118B0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -286740,7 +286547,7 @@ int __thiscall cTagDBDatabase::CopyDataToOutput(cTagDBDatabase *this, cTagDBOutp // 511C8A: variable 'v4' is possibly undefined //----- (00511CA0) -------------------------------------------------------- -void __thiscall cTagDBDatabase::Insert(cTagDBDatabase *this, ITagDBKeySet *pSet, sTagDBData Data) +void __thiscall cTagDBDatabase::Insert(cTagDBDatabase *this, ITagDBKeySet *pSet, const sTagDBData Data) { unsigned int Iter; // [esp+4h] [ebp-4h] BYREF @@ -286753,7 +286560,7 @@ void __thiscall cTagDBDatabase::Insert(cTagDBDatabase *this, ITagDBKeySet *pSet, void __thiscall cTagDBDatabase::InsertRecursively( cTagDBDatabase *this, ITagDBKeySet *pSet, - sTagDBData Data, + const sTagDBData Data, unsigned int *pIter) { cBranch *v4; // eax @@ -287473,7 +287280,7 @@ void __thiscall cDABase>::~cDABasem_pItems ) { cDARawSrvFns::PreSetSize(this->m_pItems, this->m_nItems, 0); - cDABaseSrvFns::DoResize((void **)&this->m_pItems, 8u, 0); + cDABaseSrvFns::DoResize((void **)this, 8u, 0); } } @@ -287573,7 +287380,7 @@ int __thiscall cDABase>::SetSize( //----- (00513870) -------------------------------------------------------- void __cdecl cDARawSrvFns::ConstructItem(sTagDBData *pItem, const sTagDBData *pFrom) { - memcpy(pItem, pFrom, sizeof(sTagDBData)); + memcpy((void *)pItem, pFrom, sizeof(sTagDBData)); } //----- (00513890) -------------------------------------------------------- @@ -287658,7 +287465,7 @@ int __thiscall cDABase>::Resize( if ( this->m_nItems == newSlotCount ) return 1; else - return cDABaseSrvFns::DoResize((void **)&this->m_pItems, 8u, newSlotCount); + return cDABaseSrvFns::DoResize((void **)this, 8u, newSlotCount); } //----- (00513AD0) -------------------------------------------------------- @@ -287717,7 +287524,7 @@ void __thiscall cTagDBInput::CombineDuplicates(cTagDBInput *this) { int iLimit; // [esp+8h] [ebp-Ch] cTagDBInputTag *pArray; // [esp+Ch] [ebp-8h] - int i; // [esp+10h] [ebp-4h] + signed int i; // [esp+10h] [ebp-4h] iLimit = cDABase>::Size(this) - 1; pArray = cDABase>::AsPointer(this); @@ -289113,7 +288920,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -289123,7 +288930,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 5163E0: using guessed type char var_10[4]; //----- (00516450) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -289163,7 +288969,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -289176,13 +288982,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cAnimTexOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 516540: using guessed type char var_10[4]; //----- (005165F0) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -289194,7 +288999,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -289214,7 +289019,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cAnimTexOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cAnimTexOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -289230,7 +289035,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 5165F0: using guessed type char var_18[4]; //----- (00516700) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -289323,7 +289127,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -289335,7 +289139,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5168E0: using guessed type char var_C[4]; //----- (00516970) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -289359,7 +289162,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (005169D0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -289369,7 +289172,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cAnimTexOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5169D0: using guessed type char var_8[4]; //----- (00516A60) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -289640,7 +289442,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -289668,7 +289470,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5170AC: variable 'v4' is possibly undefined -// 517010: using guessed type char var_10[4]; //----- (00517110) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -289839,7 +289640,7 @@ ILoopClient *__stdcall CreateTestClient(sLoopClientDesc *pDesc, tLoopClientData_ } //----- (005175F0) -------------------------------------------------------- -grs_bitmap *__cdecl texmemBuildCheckerboardTmap(int shift, int seed, int trans) +grs_bitmap *__cdecl texmemBuildCheckerboardTmap(int shift, unsigned int seed, int trans) { unsigned __int16 flags; // cx unsigned __int8 v5; // [esp+0h] [ebp-48h] @@ -290214,7 +290015,7 @@ grs_bitmap *_texmemMakeDefMaps() texmem_default_maps[0] = setup_default_tmap(5, 0); result = setup_default_tmap(4, 1); - dword_B9806C = result; + tm = result; if ( !texmem_inviso_maps ) { result = setup_inviso_tmaps(); @@ -290405,8 +290206,8 @@ int __thiscall texmemClearAll(void *this) texmem_align_set[i] = -1; } texmemSetLocked(0, texmem_default_maps[0]); - texmemSetLocked(247, dword_B9806C); - texmemSetLocked(248, dword_B9806C); + texmemSetLocked(247, tm); + texmemSetLocked(248, tm); result = j__texmemSkyStarControl(skystar_value); texmem_cur_max = 1; texmem_cur_loadid = 2; @@ -290766,7 +290567,7 @@ IObjectSystem *terrainprop_load() for ( i = 0; i < 64; ++i ) { sprintf(varname, "%s%2.2d", aTerrprop, i); - if ( config_get_raw(varname, terr_schema[i], 32) ) + if ( config_get_raw(varname, terr_schema[i], 0x20u) ) { our_schema = ((int (__thiscall *)(IObjectSystem *, IObjectSystem *, char *))objSys->GetObjectNamed)( objSys, @@ -290788,22 +290589,22 @@ IObjectSystem *terrainprop_load() //----- (005194E0) -------------------------------------------------------- int __cdecl texture_Save(ITagFile *file) { - int rva; // [esp+0h] [ebp-4h] + BOOL rva; // [esp+0h] [ebp-4h] int rv; // [esp+0h] [ebp-4h] if ( !texsave_enabled ) return 0; rva = saveAllFamilies(file); - rv = saveAllTextures(file) | rva; + rv = saveAllTextures(file) || rva; if ( !rv ) DbgReportWarning(aSomeTextureCom); return rv; } //----- (0051953A) -------------------------------------------------------- -int __cdecl saveAllFamilies(ITagFile *file) +BOOL __cdecl saveAllFamilies(ITagFile *file) { - int rv; // [esp+0h] [ebp-10h] + BOOL rv; // [esp+0h] [ebp-10h] char *mem; // [esp+4h] [ebp-Ch] blockHeader theHdr; // [esp+8h] [ebp-8h] BYREF @@ -290816,10 +290617,10 @@ int __cdecl saveAllFamilies(ITagFile *file) } //----- (00519598) -------------------------------------------------------- -int __cdecl saveGenericBlocked(ITagFile *file, blockHeader *hdr, const char *mem, _TagFileTag *tag, VersionNum *ver) +BOOL __cdecl saveGenericBlocked(ITagFile *file, blockHeader *hdr, const char *mem, _TagFileTag *tag, VersionNum *ver) { int write_sz; // [esp+0h] [ebp-8h] - int rv; // [esp+4h] [ebp-4h] + BOOL rv; // [esp+4h] [ebp-4h] rv = 0; if ( file->OpenBlock(file, tag, ver) ) @@ -290832,9 +290633,9 @@ int __cdecl saveGenericBlocked(ITagFile *file, blockHeader *hdr, const char *mem } //----- (0051961A) -------------------------------------------------------- -int __cdecl saveAllTextures(ITagFile *file) +BOOL __cdecl saveAllTextures(ITagFile *file) { - int rv; // [esp+0h] [ebp-Ch] + BOOL rv; // [esp+0h] [ebp-Ch] int size; // [esp+4h] [ebp-8h] char *mem; // [esp+8h] [ebp-4h] @@ -291072,7 +290873,7 @@ int __cdecl GetTextureObj(unsigned int idx) char buf[32]; // [esp+0h] [ebp-24h] BYREF int obj; // [esp+20h] [ebp-4h] - if ( idx >= 0xF9 ) + if ( idx > 0xF8 ) return 0; if ( !gArchMap[idx] ) j__RebuildTextureArchetypes(); @@ -291848,10 +291649,10 @@ void __cdecl read_key_and_menu_bindings() { char path[128]; // [esp+0h] [ebp-80h] BYREF - memset(&uibindpath, 0, sizeof(uibindpath)); + memset((void *)&uibindpath, 0, sizeof(uibindpath)); DatapathAdd(&uibindpath, aRPrjThief2Src); path[0] = 0; - config_get_raw(aKeybindPath, path, 128); + config_get_raw(aKeybindPath, path, 0x80u); DatapathAdd(&uibindpath, path); path[0] = 0; DatapathFind(&uibindpath, aMenusCfg, path, 0x80u); @@ -291950,7 +291751,7 @@ void GameInitGUI() cAutoIPtr::cAutoIPtr(&pResMan, Aggregated); strcpy(buf, "default\\font"); memset(&buf[13], 0, 243); - cfg_get_lang(aGuiFont, buf, 256); + cfg_get_lang(aGuiFont, buf, 0x100u); strip_trailing(buf); v1 = cIPtr::operator->(&pResMan); gGUIFont = v1->Bind(v1, buf, aFont_3, 0, 0, 0); @@ -291972,12 +291773,12 @@ char *__cdecl strip_trailing(char *arg) } //----- (0051B9B0) -------------------------------------------------------- -int __cdecl cfg_get_lang(const char *var, char *buf, int buflen) +int __cdecl cfg_get_lang(const char *var, char *buf, size_t buflen) { char langvar[256]; // [esp+0h] [ebp-140h] BYREF char lang[64]; // [esp+100h] [ebp-40h] BYREF - if ( config_get_raw(aLanguage_0, lang, 64) + if ( config_get_raw(aLanguage_0, lang, 0x40u) && (sprintf(langvar, "%s_%s", lang, var), config_get_raw(langvar, buf, buflen)) ) { return 1; @@ -292091,7 +291892,7 @@ void __cdecl load_style_fonts(const char *prefix, guiStyle *style, const char *r for ( i = 0; (unsigned int)i < 2; ++i ) { sprintf(var, "%s%s", prefix, font_cfg_vars[i]); - if ( cfg_get_lang(var, font, 256) ) + if ( cfg_get_lang(var, font, 0x100u) ) { if ( config_spew_on && CfgSpewTest(aFontLoadSpew) ) CfgDoSpew("Loading %s for %s\n", font, var); @@ -292551,16 +292352,16 @@ int SetDerivedGlobals() mxs_vector YAxis; // [esp+4h] [ebp-10h] BYREF int i; // [esp+10h] [ebp-4h] - *(_QWORD *)&g_LastSphereCheck.x = 0i64; + *(_QWORD *)&g_LastSphereCheck.x = 0LL; g_LastSphereCheck.z = -100000000.0; - *(_QWORD *)&g_MakeNewPos.x = 0i64; + *(_QWORD *)&g_MakeNewPos.x = 0LL; g_MakeNewPos.z = -100000000.0; cDABase>::SetSize(&g_Precip, 0); cDABase>::SetSize(&g_Splash, 0); *(_QWORD *)&g_PrecipFall.x = *(_QWORD *)&g_Weather.m_Wind.x; g_PrecipFall.z = g_Weather.m_Wind.z - g_Weather.m_fPrecipFallSpeed; g_fPrecipFallSpeed = mx_norm_vec(&g_PrecipFallUnit, &g_PrecipFall) * 0.001; - *(_QWORD *)&YAxis.x = 0x3F80000000000000i64; + *(_QWORD *)&YAxis.x = 0x3F80000000000000LL; YAxis.z = 0.0; mx_cross_vec(&g_PrecipPerp1, &YAxis, &g_PrecipFallUnit); mx_cross_vec(&g_PrecipPerp2, &g_PrecipPerp1, &g_PrecipFallUnit); @@ -292698,7 +292499,7 @@ void __cdecl WeatherRender() if ( __PAIR64__(iNum, v0) ) { r3_start_block(); - r3_set_polygon_context(0x20000); + r3_set_polygon_context(0x20000u); lgd3d_set_zcompare(1); lgd3d_set_zwrite(0); lgd3d_set_alpha(g_Weather.m_fAlpha); @@ -292900,9 +292701,9 @@ void __cdecl WeatherRender() if ( g_pfnNextPostRenderCallback_0 ) g_pfnNextPostRenderCallback_0(); } -// 9DB330: using guessed type void *off_9DB330; -// 9DB334: using guessed type void *off_9DB334; -// 9DB338: using guessed type void *off_9DB338; +// 9DB330: using guessed type _UNKNOWN *off_9DB330; +// 9DB334: using guessed type _UNKNOWN *off_9DB334; +// 9DB338: using guessed type _UNKNOWN *off_9DB338; //----- (0051DA3A) -------------------------------------------------------- void WeatherInit() @@ -293012,7 +292813,7 @@ void SetNumCells() //----- (0051DD4B) -------------------------------------------------------- void __cdecl WeatherRoomToWREndCallback() { - int v0; // [esp+0h] [ebp-20h] + PortalPolygonCore *v0; // [esp+0h] [ebp-20h] int k; // [esp+8h] [ebp-18h] PortalPolygonCore *pPortal; // [esp+Ch] [ebp-14h] int j; // [esp+14h] [ebp-Ch] @@ -293035,9 +292836,9 @@ void __cdecl WeatherRoomToWREndCallback() { for ( k = 0; k < pCell->num_portal_polys; ++k ) { - v0 = (int)&pCell->portal_poly_list[k]; - if ( (wr_cell[*(unsigned __int16 *)(v0 + 4)]->flags & 0x40) != 0 ) - *(_BYTE *)v0 |= 0x10u; + v0 = &pCell->portal_poly_list[k]; + if ( (wr_cell[v0->destination]->flags & 0x40) != 0 ) + v0->flags |= 0x10u; } } } @@ -293116,7 +292917,7 @@ void __cdecl WeatherLoad(ITagFile *pFile) void __cdecl WeatherFrame(unsigned int nMillisec) { float s; // [esp+0h] [ebp-868h] - int v2; // [esp+Ch] [ebp-85Ch] + BOOL v2; // [esp+Ch] [ebp-85Ch] mxs_vector ToPos; // [esp+14h] [ebp-854h] BYREF float fMoveDist; // [esp+20h] [ebp-848h] float fCamSpeed; // [esp+24h] [ebp-844h] @@ -293881,7 +293682,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -293895,7 +293696,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 51FCA0: using guessed type char var_8[4]; //----- (0051FD50) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -293925,7 +293725,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -293940,7 +293740,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cWeatherOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -293948,7 +293748,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 51FE00: using guessed type char var_C[4]; //----- (0051FEE0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -293959,7 +293758,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -293968,7 +293767,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cWeatherOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cWeatherOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -293983,7 +293782,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 51FF70: variable 'v5' is possibly undefined -// 51FEE0: using guessed type char var_C[4]; //----- (0051FFB0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -294066,7 +293864,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -294078,7 +293876,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5201D0: using guessed type char var_C[4]; //----- (00520260) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -294102,7 +293899,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (005202C0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -294112,7 +293909,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cWeatherOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5202C0: using guessed type char var_8[4]; //----- (00520350) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -294342,7 +294138,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -294370,7 +294166,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 52093C: variable 'v4' is possibly undefined -// 5208A0: using guessed type char var_10[4]; //----- (005209A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -294553,7 +294348,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -294883,7 +294678,7 @@ int __cdecl FindPortalPlane(bsp_node *n, PortalPlane **pPlane, int *reversed) } //----- (00521673) -------------------------------------------------------- -unsigned int __cdecl wrBspLeafCreate(unsigned int parent_index, int cell_id) +unsigned int __cdecl wrBspLeafCreate(unsigned int parent_index, unsigned int cell_id) { unsigned int v3; // [esp+0h] [ebp-18h] __cAutoAllocCredit _AAC___LINE__; // [esp+4h] [ebp-14h] BYREF @@ -295989,7 +295784,7 @@ unsigned int __cdecl cHashTableFunctions::Hash(const int *k) } //----- (00523C20) -------------------------------------------------------- -unsigned int __cdecl cHashFunctions::Hash(unsigned int p) +unsigned int __cdecl cHashFunctions::Hash(int p) { return HashPtr(p); } @@ -296510,7 +296305,7 @@ void __cdecl wrFree(unsigned __int8 *ptr) unsigned int __cdecl WriteWR(void (__cdecl *func)(void *, unsigned int, unsigned int)) { int v1; // esi - int lightmap_size; // [esp+4h] [ebp-34h] + unsigned int lightmap_size; // [esp+4h] [ebp-34h] st_PortalLightMap templist; // [esp+8h] [ebp-30h] BYREF unsigned int alloced_bytes_written; // [esp+1Ch] [ebp-1Ch] int num_light_indices; // [esp+20h] [ebp-18h] BYREF @@ -296591,7 +296386,7 @@ void __cdecl ReadWR(void (__cdecl *func)(void *, unsigned int, unsigned int)) unsigned __int8 *v1; // eax int v2; // esi unsigned __int8 *v3; // eax - int lightmap_size; // [esp+4h] [ebp-18h] + unsigned int lightmap_size; // [esp+4h] [ebp-18h] int num_light_indices; // [esp+8h] [ebp-14h] BYREF int ci; // [esp+Ch] [ebp-10h] int i; // [esp+10h] [ebp-Ch] @@ -297069,7 +296864,7 @@ void __thiscall cAIAbility::SignalGoal(cAIAbility *this) } //----- (00526B60) -------------------------------------------------------- -void __thiscall cAITimer::Set(cAITimer *this, unsigned int period) +void __thiscall cAITimer::Set(cAITimer *this, eAITimerPeriod period) { this->m_Period = period; this->m_Expiration = this->m_Period + j__GetSimTime(); @@ -297480,7 +297275,7 @@ void __thiscall cAI::cAI(cAI *this) this->m_pCurGoal = 0; this->m_CurActionLastResult = kAIR_Undefined; this->m_CurGoalLastResult = kAIR_Undefined; - memset(&this->m_state, 0, sizeof(this->m_state)); + memset((void *)&this->m_state, 0, sizeof(this->m_state)); this->m_state.nCurrentMedium = -1; cAIState::SetMode(&this->m_state, kAIM_Normal); this->m_pBehaviorSet = 0; @@ -298145,7 +297940,7 @@ double __thiscall cAI::AdjustMvrGroundHeight(cAI *this, const Location *pLoc, fl mxs_vector loc; // [esp+18h] [ebp-10h] BYREF sAIState *pState; // [esp+24h] [ebp-4h] - pState = &this->m_state; + pState = &this->m_state.sAIState; if ( this->m_state.cell ) { if ( AIFindClosestConnectedCell(pState->cell, &pState->pathLoc, &pLoc->vec, &cell, &loc, pState->nStressBits) ) @@ -298400,7 +298195,7 @@ void __thiscall cAI::UpdateState(cAI *this) eAIMode v8; // eax IScriptMan *Aggregated; // eax IScriptMan *v10; // [esp+0h] [ebp-A8h] - int v11; // [esp+4h] [ebp-A4h] + BOOL v11; // [esp+4h] [ebp-A4h] sMediumTransMsg MTMessage; // [esp+Ch] [ebp-9Ch] BYREF cAutoIPtr pScriptMan; // [esp+4Ch] [ebp-5Ch] BYREF int cell; // [esp+50h] [ebp-58h] @@ -298417,7 +298212,7 @@ void __thiscall cAI::UpdateState(cAI *this) eAIMode prevMode; // [esp+A0h] [ebp-8h] sAIState *pState; // [esp+A4h] [ebp-4h] - pState = &this->m_state; + pState = &this->m_state.sAIState; prevLoc = this->m_state.position.loc.vec; if ( GetObjPosition(this->m_state.id, &this->m_state.position) ) { @@ -298540,7 +298335,7 @@ void __thiscall cAI::UpdateProperties(cAI *this, eAIPropUpdateKind kind) eAIAwareLevel alertness; // [esp+Ch] [ebp-8h] sAIState *pState; // [esp+10h] [ebp-4h] - pState = &this->m_state; + pState = &this->m_state.sAIState; if ( kind == kAI_FromProps ) { ID = cAI::GetID(this); @@ -298610,7 +298405,7 @@ void __thiscall cAI::UpdateAlertness(cAI *this) eAIAwareLevel v11; // [esp-4h] [ebp-34h] sAIAlertness *v12; // [esp-4h] [ebp-34h] eAIAwareLevel level; // [esp+0h] [ebp-30h] - sAIAwareness *v14; // [esp+4h] [ebp-2Ch] + const sAIAwareness *v14; // [esp+4h] [ebp-2Ch] eAIAwareLevel targetLevel; // [esp+Ch] [ebp-24h] int source; // [esp+18h] [ebp-18h] eAIAwareLevel previous; // [esp+1Ch] [ebp-14h] @@ -298622,13 +298417,13 @@ void __thiscall cAI::UpdateAlertness(cAI *this) ID = cAI::GetID(this); pAlertness = AIGetProperty(g_pAIAlertnessProperty, ID, 0); if ( this->m_pSenses ) - v14 = (sAIAwareness *)this->m_pSenses->GetHighAwareness(this->m_pSenses, 4, 0x7FFFFFFF); + v14 = this->m_pSenses->GetHighAwareness(this->m_pSenses, 4, 0x7FFFFFFF); else v14 = 0; if ( !pAlertness ) _CriticalMsg(aExpectedAlertn, aRPrjThief2Skup_2108, 0x52Bu); previous = pAlertness->level; - pState = &this->m_state; + pState = &this->m_state.sAIState; if ( v14 && pAlertness->level == kAIAL_High && sAIAwareness::TimeSinceContact(v14) < g_AITimeMaxAlert ) { targetLevel = kAIAL_High; @@ -298818,7 +298613,7 @@ eAIResult __thiscall cAI::UpdateAction(cAI *this) } //----- (00529B82) -------------------------------------------------------- -int __thiscall cAI::UpdateGoal(cAI *this) +eAIResult __thiscall cAI::UpdateGoal(cAI *this) { int currentResult; // [esp+4h] [ebp-4h] @@ -299128,8 +298923,8 @@ int __cdecl GoalCompare(cAIGoal **ppGoal1, cAIGoal **ppGoal2) (*ppGoal1)->pOwner, (*ppGoal1)->pOwner); pAIState = (const cAIState *)(*(int (__stdcall **)(int))(*(_DWORD *)v4 + 100))(v4); - distSq1 = cAIState::DistSq((cAIState *)pAIState, &(*ppGoal1)->location); - distSq2 = cAIState::DistSq((cAIState *)pAIState, &(*ppGoal2)->location); + distSq1 = cAIState::DistSq(pAIState, &(*ppGoal1)->location); + distSq2 = cAIState::DistSq(pAIState, &(*ppGoal2)->location); return pflcmp(&distSq1, &distSq2); } return result; @@ -300051,8 +299846,8 @@ int __stdcall cAI::Save(cAI *this, ITagFile *pTagFile) cAI::sAIAbilityInfo *v10; // eax int v11; // eax cAIGoal *pGoal; // [esp-4h] [ebp-48h] - int v13; // [esp+0h] [ebp-44h] - int v14; // [esp+8h] [ebp-3Ch] + BOOL v13; // [esp+0h] [ebp-44h] + BOOL v14; // [esp+8h] [ebp-3Ch] IAIAbility *pAbility; // [esp+Ch] [ebp-38h] int fHasCurAction; // [esp+14h] [ebp-30h] BYREF int fIsCurAbility; // [esp+18h] [ebp-2Ch] BYREF @@ -300643,7 +300438,7 @@ unsigned int __thiscall sAIAwareness::TimeSinceContact(sAIAwareness *this) //----- (0052E720) -------------------------------------------------------- void __thiscall sAIAwareness::sAIAwareness(sAIAwareness *this) { - memset(this, 0, sizeof(sAIAwareness)); + memset((void *)this, 0, sizeof(sAIAwareness)); } //----- (0052E750) -------------------------------------------------------- @@ -301762,7 +301557,7 @@ sAIAlertCap *__cdecl AIGetProperty(IAIAlertCapProperty *pProp, int obj, sAIAlert //----- (00530820) -------------------------------------------------------- sAIModeSuggestion *__cdecl _AIDecide( sAIModeSuggestion **ppOptions, - unsigned int nOptions, + size_t nOptions, int (__cdecl *pfnCompare)(const void *, const void *), sAIModeSuggestion *pTieBreakVoid) { @@ -301796,7 +301591,7 @@ sAIModeSuggestion *__cdecl _AIDecide( //----- (00530920) -------------------------------------------------------- cAIGoal *__cdecl _AIDecide( cAIGoal **ppOptions, - int nOptions, + size_t nOptions, int (__cdecl *pfnCompare)(const void *, const void *), cAIGoal *pTieBreakVoid) { @@ -302102,7 +301897,7 @@ void __thiscall cAIObjectAvoidProperty::RebuildConcrete( int *v5; // eax sAIObjectAvoid *pObjectAvoid; // [esp+4h] [ebp-Ch] unsigned int iPrev; // [esp+8h] [ebp-8h] - int fHad; // [esp+Ch] [ebp-4h] + BOOL fHad; // [esp+Ch] [ebp-4h] pObjectAvoid = (sAIObjectAvoid *)val.intval; for ( iPrev = 0; iPrev < cDABase>::Size(&m_AIRepelObjects); ++iPrev ) @@ -302695,7 +302490,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -302709,7 +302504,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 531E90: using guessed type char var_8[4]; //----- (00531F40) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -302749,7 +302543,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -302767,7 +302561,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -302775,7 +302569,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 531FF0: using guessed type char var_C[4]; //----- (005320D0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -302786,7 +302579,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -302795,7 +302588,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -302810,7 +302603,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 532160: variable 'v5' is possibly undefined -// 5320D0: using guessed type char var_C[4]; //----- (005321A0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -302900,7 +302692,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -302912,7 +302704,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5323C0: using guessed type char var_C[4]; //----- (00532450) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -302943,7 +302734,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -302953,7 +302744,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5324B0: using guessed type char var_8[4]; //----- (00532540) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -303203,7 +302993,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -303231,7 +303021,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 532B8C: variable 'v4' is possibly undefined -// 532AF0: using guessed type char var_10[4]; //----- (00532BF0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -303377,7 +303166,7 @@ void __thiscall cAIAbility::~cAIAbility(cAIAbility *this) void __stdcall cAIAbility::ConnectAbility(cAIAbility *this, unsigned int **ppSignals) { *ppSignals = &this->m_signals; - this->m_DebugID = cAIState::GetID((cAIState *)this->m_pAIState); + this->m_DebugID = cAIState::GetID(this->m_pAIState); this->m_pDebugAI = this->m_pAI; this->m_pDebugAIState = this->m_pAIState; } @@ -303982,7 +303771,7 @@ void __thiscall cAIComponentBase::SetNot { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -304035,7 +303824,7 @@ void __cdecl AITagMove(ITagFile *pTagFile, eAIGoalType *pItem) int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (00533AC0) -------------------------------------------------------- @@ -306801,7 +306590,7 @@ void __thiscall sAIMoveGoal::sAIMoveGoal(sAIMoveGoal *this) { floatang::floatang(&this->dir); cMxsVector::cMxsVector(&this->dest); - memset(this, 0, sizeof(sAIMoveGoal)); + memset((void *)this, 0, sizeof(sAIMoveGoal)); } //----- (00537DA0) -------------------------------------------------------- @@ -306960,8 +306749,8 @@ void __thiscall cAIPsdScrAction::cAIPsdScrAction(cAIPsdScrAction *this, IAIActor cAIAction::cAIAction(this, 0xEu, pOwner, data); this->m_iCurrent = 0; cDynArray::cDynArray(&this->m_actions); - this->m_source = cAIState::GetID((cAIState *)this->m_pAIState); - this->m_dest = cAIState::GetID((cAIState *)this->m_pAIState); + this->m_source = cAIState::GetID(this->m_pAIState); + this->m_dest = cAIState::GetID(this->m_pAIState); this->m_pCurrent = 0; this->__vftable = (cAIPsdScrAction_vtbl *)&cAIPsdScrAction::`vftable'; } @@ -308732,7 +308521,7 @@ int __thiscall cDABase>::Resize( int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A0D0) -------------------------------------------------------- @@ -308750,7 +308539,7 @@ void __thiscall cAIComponentBase::cAICompone int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A170) -------------------------------------------------------- @@ -308768,7 +308557,7 @@ void __thiscall cAIComponentBase int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A1F0) -------------------------------------------------------- @@ -308803,7 +308592,7 @@ unsigned int __stdcall cCTUnaggregated::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A2F0) -------------------------------------------------------- @@ -308821,7 +308610,7 @@ void __thiscall cAIComponentBase::cAICompo int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A370) -------------------------------------------------------- @@ -308856,7 +308645,7 @@ unsigned int __stdcall cCTUnaggregated:: int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A470) -------------------------------------------------------- @@ -308874,7 +308663,7 @@ void __thiscall cAIComponentBase:: int __thiscall cAIComponentBase::GetID( cAIComponentBase *this) { - return cAIState::GetID((cAIState *)this->m_pAIState); + return cAIState::GetID(this->m_pAIState); } //----- (0053A4F0) -------------------------------------------------------- @@ -309056,7 +308845,7 @@ void __thiscall cAIComponentBase::Se { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -309080,7 +308869,7 @@ void __thiscall cAIComponentBase::Cl { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -309480,7 +309269,7 @@ void __thiscall cAIComponentBase::SetNotific { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -309504,7 +309293,7 @@ void __thiscall cAIComponentBase::ClearNotif { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -309563,7 +309352,7 @@ void __thiscall cAIComponentBase::ClearN { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -309941,7 +309730,7 @@ void __thiscall cAIComponentBase { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -309965,7 +309754,7 @@ void __thiscall cAIComponentBase { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -310024,7 +309813,7 @@ void __thiscall cAIComponentBase::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -310048,7 +309837,7 @@ void __thiscall cAIComponentBase::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -310461,7 +310250,7 @@ void __thiscall cAIComponentBase::SetNotif { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -310485,7 +310274,7 @@ void __thiscall cAIComponentBase::ClearNot { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -310544,7 +310333,7 @@ void __thiscall cAIComponentBase::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -310568,7 +310357,7 @@ void __thiscall cAIComponentBase::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -310981,7 +310770,7 @@ void __thiscall cAIComponentBase:: { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->ListenForCollisions(v5, ID); @@ -311005,7 +310794,7 @@ void __thiscall cAIComponentBase:: { Aggregated = (IAIManager *)_AppGetAggregated(&IID_IAIManager); cAutoIPtr::cAutoIPtr(&pAIManager, Aggregated); - v3 = (cAIState *)this->m_pAI->GetState(this->m_pAI); + v3 = this->m_pAI->GetState(this->m_pAI); ID = cAIState::GetID(v3); v5 = cIPtr::operator->(&pAIManager); v5->UnlistenForCollisions(v5, ID); @@ -311448,13 +311237,13 @@ void __cdecl AIForgetToggle(char *str) // BA2434: using guessed type int g_fAIForgetPlayer[25]; //----- (0053CF25) -------------------------------------------------------- -void __cdecl AICamToCell(int cell) +void __cdecl AICamToCell(unsigned int cell) { mxs_vector *Center; // eax mxs_vector *pos; // [esp+0h] [ebp-8h] BYREF mxs_angvec *ang; // [esp+4h] [ebp-4h] BYREF - if ( cell >= 1 && cell <= g_AIPathDB.m_nCells ) + if ( (int)cell >= 1 && cell <= g_AIPathDB.m_nCells ) { AIDebugMagicLocatorCell = cell; if ( j__vm_spotlight_loc(&pos, &ang) && pos ) @@ -311638,9 +311427,9 @@ IAIPath *GenericTest() mxs_vector fromLocation; // [esp+18h] [ebp-14h] BYREF unsigned __int8 OkBits; // [esp+28h] [ebp-4h] - *(_QWORD *)&fromLocation.x = 0xC3040354C26A4396ui64; + *(_QWORD *)&fromLocation.x = 0xC3040354C26A4396uLL; fromLocation.z = -3.516; - *(_QWORD *)&toLocation.x = 0xC30EAB85C2BC570Aui64; + *(_QWORD *)&toLocation.x = 0xC30EAB85C2BC570AuLL; toLocation.z = 3.0; OkBits = 17; return AIPathfind(&fromLocation, 0, &toLocation, 0, 0x11u, 0); @@ -311653,11 +311442,11 @@ int AIReportLargeDoorSize() } //----- (0053D4BE) -------------------------------------------------------- -void __cdecl ForceAIMode(int nMode) +void __cdecl ForceAIMode(eAIMode nMode) { - if ( nMode >= 0 ) + if ( nMode >= kAIM_Asleep ) { - if ( nMode <= 6 ) + if ( nMode <= kAIM_Num ) g_ForceAIMode = nMode; else g_ForceAIMode = kAIM_Num; @@ -311771,7 +311560,7 @@ int __thiscall cAIConversationManager::CheckActors(cAIConversationManager *this, cAutoIPtr::~cAutoIPtr(&pAIManager); return 0; } - v5 = (cAIState *)pInternalAI->GetState(pInternalAI); + v5 = pInternalAI->GetState(pInternalAI); Alertness = cAIState::GetAlertness(v5); if ( Alertness >= pConversationDesc->abortLevel ) { @@ -311940,7 +311729,7 @@ int __stdcall cAIConversationManager::GetActorIDs(cAIConversationManager *this, { int k; // [esp+0h] [ebp-1Ch] int j; // [esp+4h] [ebp-18h] - int found; // [esp+8h] [ebp-14h] + BOOL found; // [esp+8h] [ebp-14h] int actorID; // [esp+Ch] [ebp-10h] int nActors; // [esp+10h] [ebp-Ch] int i; // [esp+14h] [ebp-8h] @@ -312399,7 +312188,7 @@ void __thiscall cAIConversor::cAIConversor(cAIConversor *this, int actorID, int { IAIManager *Aggregated; // eax IAIManager *v4; // [esp+0h] [ebp-1Ch] - int found; // [esp+8h] [ebp-14h] + BOOL found; // [esp+8h] [ebp-14h] tAIIter__ *iter; // [esp+Ch] [ebp-10h] BYREF IAIComponent *pComponent; // [esp+10h] [ebp-Ch] cAutoIPtr pAIManager; // [esp+14h] [ebp-8h] BYREF @@ -313358,7 +313147,7 @@ int __thiscall cAIDetect::SearchForBodies(cAIDetect *this) all_robot = 1; ID = cAIComponentBase::GetID(this); ourLoc = j__ObjPosGet(ID); - if ( this->m_SeenBody || cAIState::GetMode((cAIState *)this->m_pAIState) != kAIM_Normal ) + if ( this->m_SeenBody || cAIState::GetMode(this->m_pAIState) != kAIM_Normal ) return 0; mx_ang2mat(&tempmatrix, &ourLoc->fac); ourvecfac = tempmatrix.vec[0]; @@ -313375,7 +313164,7 @@ int __thiscall cAIDetect::SearchForBodies(cAIDetect *this) pAIState = (const cAIState *)pAI->__vftable[2].AddRef(pAI); if ( j__ObjHasRefs(targ) ) { - if ( cAIState::IsDead((cAIState *)pAIState) ) + if ( cAIState::IsDead(pAIState) ) { v6 = cAIComponentBase::GetID(this); if ( v6 != targ ) @@ -313388,7 +313177,7 @@ int __thiscall cAIDetect::SearchForBodies(cAIDetect *this) { themLoc = j__ObjPosGet(targ); mx_sub_vec(&relfac, &themLoc->loc.vec, &ourLoc->loc.vec); - distSq = cAIState::DistSq((cAIState *)this->m_pAIState, &themLoc->loc.vec); + distSq = cAIState::DistSq(this->m_pAIState, &themLoc->loc.vec); if ( distSq < 225.0 && j__mx_dot_vec(&relfac, &ourvecfac) >= 0.0 ) { if ( j__PortalRaycast(&themLoc->loc, &ourLoc->loc, &hit, 0) ) @@ -313475,7 +313264,7 @@ int __thiscall cAIDetect::SearchForSuspicious(cAIDetect *this) m_LastSuspicious = 0; mx_ang2mat(&tempmatrix, &ourLoc->fac); ourvecfac = tempmatrix.vec[0]; - if ( cAIState::GetMode((cAIState *)this->m_pAIState) != kAIM_Normal ) + if ( cAIState::GetMode(this->m_pAIState) != kAIM_Normal ) return 0; StartSuspiciousIter(&iter); while ( NextSuspiciousIter(&iter, &targ, &iscurrentsuspicious) ) @@ -313499,7 +313288,7 @@ int __thiscall cAIDetect::SearchForSuspicious(cAIDetect *this) if ( !GetSuspiciousLightLevel(targ, &minlightlevel) ) minlightlevel = 0.15000001; mx_sub_vec(&relfac, &themLoc->loc.vec, &ourLoc->loc.vec); - distSq = cAIState::DistSq((cAIState *)this->m_pAIState, &themLoc->loc.vec); + distSq = cAIState::DistSq(this->m_pAIState, &themLoc->loc.vec); if ( distSq < 225.0 && j__mx_dot_vec(&relfac, &ourvecfac) >= 0.0 ) { if ( j__PortalRaycast(&themLoc->loc, &ourLoc->loc, &hit, 0) ) @@ -313689,16 +313478,16 @@ int __stdcall cAIDoorMovReg::AssistGoal(cAIDoorMovReg *this, const sAIMoveGoal * g_pAIDoorLinks->Get(g_pAIDoorLinks, linkId, &link); if ( !cAITimer::Expired(&this->m_DoorWait) ) { - pResultGoal->dir = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value); - pResultGoal->dest = *cAIState::GetLocation((cAIState *)this->m_pAIState); + pResultGoal->dir = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &result)->value); + pResultGoal->dest = *cAIState::GetLocation(this->m_pAIState); pResultGoal->speed = kAIS_Stopped; return 1; } if ( GetObjLocation(link.dest, &doorLoc) ) { - v5 = cAIState::AngleTo((cAIState *)this->m_pAIState, &v43, &doorLoc); + v5 = cAIState::AngleTo(this->m_pAIState, &v43, &doorLoc); doorAng.value = Delta(&v42, v5, &goal->dir)->value; - v6 = cAIState::DistSq((cAIState *)this->m_pAIState, &doorLoc); + v6 = cAIState::DistSq(this->m_pAIState, &doorLoc); distSq = v6; if ( v6 > 16.0 && (floatang::floatang(&b, 1.0471976), operator>(&doorAng, &b)) ) { @@ -313752,11 +313541,11 @@ int __stdcall cAIDoorMovReg::AssistGoal(cAIDoorMovReg *this, const sAIMoveGoal * v12 = cDABase>::operator[](&doors->cDynArray_, i); if ( GetObjLocation(v12->obj, &doorLoc) ) { - v13 = cAIState::DistSq((cAIState *)this->m_pAIState, &doorLoc); + v13 = cAIState::DistSq(this->m_pAIState, &doorLoc); distSq = v13; if ( v13 < 36.0 ) { - v14 = cAIState::AngleTo((cAIState *)this->m_pAIState, &v39, &doorLoc); + v14 = cAIState::AngleTo(this->m_pAIState, &v39, &doorLoc); doorAng.value = Delta(&v38, v14, &goal->dir)->value; if ( distSq < 20.25 ) { @@ -313811,8 +313600,8 @@ int __stdcall cAIDoorMovReg::AssistGoal(cAIDoorMovReg *this, const sAIMoveGoal * v21 = cAIComponentBase::GetID(this); AIOpenDoor(v21, v31); cAITimer::Reset(&this->m_DoorWait); - pResultGoal->dir = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v36)->value); - pResultGoal->dest = *cAIState::GetLocation((cAIState *)this->m_pAIState); + pResultGoal->dir = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &v36)->value); + pResultGoal->dest = *cAIState::GetLocation(this->m_pAIState); pResultGoal->speed = kAIS_Stopped; cAutoIPtr::~cAutoIPtr(&v49); return 1; @@ -314338,7 +314127,7 @@ BOOL __thiscall cAIGotoGoal::Reached(cAIGotoGoal *this) cAIState *pAIState; // [esp+18h] [ebp-4h] v4 = this->pOwner->AccessOuterAI(this->pOwner); - pAIState = (cAIState *)v4->GetState(v4); + pAIState = v4->GetState(v4); if ( this->accuracyZ == 3.4028235e38 ) return cAIState::DistSq(pAIState, &this->location) < (double)this->accuracySq; v3 = cAIState::DiffZ(pAIState, &this->location); @@ -314681,12 +314470,12 @@ void __thiscall sAIInform::sAIInform(sAIInform *this, IInternalAI *pAI, unsigned int v7; // eax int v8; // [esp+0h] [ebp-10h] int v9; // [esp+4h] [ebp-Ch] - sAIAwareness *pAwareness; // [esp+Ch] [ebp-4h] + const sAIAwareness *pAwareness; // [esp+Ch] [ebp-4h] this->concept = concept; this->ofWhom = ofWhom; v9 = ((int (__stdcall *)(IInternalAI *, int))pAI->AccessSenses)(pAI, ofWhom); - pAwareness = (sAIAwareness *)(*(int (__stdcall **)(int))(*(_DWORD *)v9 + 196))(v9); + pAwareness = (const sAIAwareness *)(*(int (__stdcall **)(int))(*(_DWORD *)v9 + 196))(v9); if ( pAwareness ) { if ( sAIAwareness::ValidLastPos(pAwareness) ) @@ -314976,7 +314765,7 @@ void __stdcall cAIInform::OnActionProgress(cAIInform *this, IAIAction *pAction) int v25; // [esp+10h] [ebp-2Ch] int v26; // [esp+14h] [ebp-28h] const char *v27; // [esp+18h] [ebp-24h] - sAIAwareness *pAwareness; // [esp+1Ch] [ebp-20h] + const sAIAwareness *pAwareness; // [esp+1Ch] [ebp-20h] unsigned int j; // [esp+20h] [ebp-1Ch] int notTold; // [esp+24h] [ebp-18h] float minInformDistSqa; // [esp+28h] [ebp-14h] @@ -314985,7 +314774,7 @@ void __stdcall cAIInform::OnActionProgress(cAIInform *this, IAIAction *pAction) cDynArray awarenesses; // [esp+30h] [ebp-Ch] BYREF const sAIAwareness *pAwarenessOfRecent; // [esp+38h] [ebp-4h] - if ( cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Normal + if ( cAIState::GetMode(this->m_pAIState) == kAIM_Normal && ((int (__thiscall *)(IInternalAI *, IInternalAI *))this->m_pAI->AccessSoundEnactor)(this->m_pAI, this->m_pAI) ) { if ( cAIAbility::IsOwn(this, pAction) && !pAction->InProgress(pAction) ) @@ -315021,7 +314810,7 @@ void __stdcall cAIInform::OnActionProgress(cAIInform *this, IAIAction *pAction) v26 = ((int (__stdcall *)(IInternalAI *, int))this->m_pAI->AccessSenses)(this->m_pAI, this->m_Current.ofWhom); pAwarenessOfRecent = (const sAIAwareness *)(*(int (__stdcall **)(int))(*(_DWORD *)v26 + 196))(v26); if ( !pAwarenessOfRecent - || this->m_Current.transferDelay < sAIAwareness::TimeSinceContact((sAIAwareness *)pAwarenessOfRecent) + || this->m_Current.transferDelay < sAIAwareness::TimeSinceContact(pAwarenessOfRecent) || (v4 = cAIComponentBase::GetID(this), g_pAIForceImmediateInform->IsRelevant(g_pAIForceImmediateInform, v4)) ) { @@ -315067,7 +314856,7 @@ void __stdcall cAIInform::OnActionProgress(cAIInform *this, IAIAction *pAction) &awarenesses, i); ObjLocation = GetObjLocation(**v11); - if ( cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation) < (double)minInformDistSq ) + if ( cAIState::DistSq(this->m_pAIState, ObjLocation) < (double)minInformDistSq ) { if ( g_AIInformWatchObj == -1 || (*cDABase>::operator[]( @@ -315104,7 +314893,7 @@ void __stdcall cAIInform::OnActionProgress(cAIInform *this, IAIAction *pAction) this->m_pAI, this->m_pAI, this->m_Current.ofWhom); - pAwareness = (sAIAwareness *)(*(int (__stdcall **)(int))(*(_DWORD *)v24 + 196))(v24); + pAwareness = (const sAIAwareness *)(*(int (__stdcall **)(int))(*(_DWORD *)v24 + 196))(v24); if ( pAwareness && sAIAwareness::ValidLastPos(pAwareness) ) this->m_Current.loc = pAwareness->lastPos; v23 = ((int (__thiscall *)(IInternalAI *, IInternalAI *, unsigned int, _DWORD))this->m_pAI->AccessSoundEnactor)( @@ -316002,7 +315791,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -316016,7 +315805,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 545800: using guessed type char var_8[4]; //----- (005458B0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -316056,7 +315844,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -316074,7 +315862,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -316082,7 +315870,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 545960: using guessed type char var_C[4]; //----- (00545A40) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -316093,7 +315880,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -316102,7 +315889,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -316117,7 +315904,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 545AD0: variable 'v5' is possibly undefined -// 545A40: using guessed type char var_C[4]; //----- (00545B10) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -316207,7 +315993,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -316222,7 +316008,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 545D30: using guessed type char var_C[4]; //----- (00545DC0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -316253,7 +316038,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -316266,7 +316051,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 545E20: using guessed type char var_8[4]; //----- (00545EB0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -316512,7 +316296,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -316540,7 +316324,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 546522: variable 'v4' is possibly undefined -// 546480: using guessed type char var_10[4]; //----- (00546580) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -316670,7 +316453,7 @@ void __thiscall cDABase>::FastDeleteItem unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -316699,7 +316482,7 @@ int __cdecl AIGetProperty(IIntProperty *pProp, int obj, int defVal) //----- (00546A70) -------------------------------------------------------- void __cdecl AITagMove(ITagFile *pTagFile, sAIInform *pItem) { - AITagMoveRaw(pTagFile, pItem, 0x38u); + AITagMoveRaw(pTagFile, (void *)pItem, 0x38u); } //----- (00546A90) -------------------------------------------------------- @@ -319158,7 +318941,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -319177,7 +318960,7 @@ void __thiscall cDABase>::FastDeleteItem( //----- (0054B300) -------------------------------------------------------- void __thiscall cDABase>::cDABase>( cDABase > *this, - int size) + unsigned int size) { this->m_pItems = 0; this->m_nItems = 0; @@ -319324,7 +319107,7 @@ void __thiscall cDABase= this->m_nItems ) { @@ -320073,7 +319856,7 @@ void __stdcall cAIMoveEnactor::OnModeChange(cAIMoveEnactor *this, eAIMode previo if ( mode < kAIM_Efficient ) { - if ( !cAIState::IsCreature((cAIState *)this->m_pAIState) ) + if ( !cAIState::IsCreature(this->m_pAIState) ) goto LABEL_6; ID = cAIComponentBase::GetID(this); pCreature = j__CreatureFromObj(ID); @@ -320104,7 +319887,7 @@ int __stdcall cAIMoveEnactor::GetStatus(cAIMoveEnactor *this) unsigned int i; // [esp+4h] [ebp-8h] eAIMEStatus status; // [esp+8h] [ebp-4h] - if ( !this->m_pMotionCoord || cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( !this->m_pMotionCoord || cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) status = cAIMoveEnactor::NonMotStatus(this); else status = cAIMoveEnactor::MotStatus(this); @@ -320152,7 +319935,7 @@ int __stdcall cAIMoveEnactor::NoAction(cAIMoveEnactor *this, unsigned int deltaT 0, 0); } - if ( !this->m_pMotionCoord || cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( !this->m_pMotionCoord || cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) return cAIMoveEnactor::NonMotNoAction(this, deltaTime); else return cAIMoveEnactor::MotNoAction(this, deltaTime); @@ -320257,7 +320040,7 @@ int __stdcall cAIMoveEnactor::EnactAction(cAIMoveEnactor *this, cAIMoveAction *p v12 = _LogFmt("AI %d made a move request with an unusually high number of tags (%d)", ID, v14); _CriticalMsg(v12, aRPrjThief2Skup_1987, 0xEFu); } - if ( !this->m_pMotionCoord || cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( !this->m_pMotionCoord || cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) return cAIMoveEnactor::NonMotEnact(this, pAction, deltaTime); else return cAIMoveEnactor::MotEnact(this, pAction, deltaTime); @@ -320309,7 +320092,7 @@ int __stdcall cAIMoveEnactor::EnactAction(cAIMoveEnactor *this, cAIMotionAction v6 = _LogFmt("AI %d made a motion request with an unusually high number of tags (%d)", ID, v8); _CriticalMsg(v6, aRPrjThief2Skup_1988, 0xFFu); } - if ( !this->m_pMotionCoord || cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( !this->m_pMotionCoord || cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) return cAIMoveEnactor::NonMotEnact(this, pAction, deltaTime); else return cAIMoveEnactor::MotEnact(this, pAction, deltaTime); @@ -320358,7 +320141,7 @@ int __stdcall cAIMoveEnactor::EnactAction(cAIMoveEnactor *this, cAIOrientAction v6 = _LogFmt("AI %d made an orient request with an unusually high number of tags (%d)", ID, v8); _CriticalMsg(v6, aRPrjThief2Skup_1989, 0x10Fu); } - if ( !this->m_pMotionCoord || cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( !this->m_pMotionCoord || cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) return cAIMoveEnactor::NonMotEnact(this, pAction, deltaTime); else return cAIMoveEnactor::MotEnact(this, pAction, deltaTime); @@ -320370,7 +320153,7 @@ int __stdcall cAIMoveEnactor::NewRegulations(cAIMoveEnactor *this) IAIMoveRegulator **v1; // eax unsigned int i; // [esp+4h] [ebp-4h] - if ( cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Efficient ) + if ( cAIState::GetMode(this->m_pAIState) == kAIM_Efficient ) return 1; for ( i = 0; i < cDABase>::Size(&this->m_MoveRegulators); ++i ) { @@ -320389,7 +320172,7 @@ int __stdcall cAIMoveEnactor::AddMovementRegulations(cAIMoveEnactor *this, cAIMo int result; // [esp+8h] [ebp-4h] result = 1; - if ( cAIState::GetMode((cAIState *)this->m_pAIState) >= kAIM_Normal ) + if ( cAIState::GetMode(this->m_pAIState) >= kAIM_Normal ) { for ( i = 0; i < cDABase>::Size(&this->m_MoveRegulators); ++i ) { @@ -320567,7 +320350,7 @@ floatang *__thiscall cAIMoveEnactor::ComputeFacing( eAIFacing facingType; // [esp+10h] [ebp-8h] floatang resulta; // [esp+14h] [ebp-4h] BYREF - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); floatang::floatang(&resulta, 0.0); if ( __$ReturnUdt->facing.type ) facingType = __$ReturnUdt->facing.type; @@ -320612,9 +320395,9 @@ int __thiscall cAIMoveEnactor::NonMotNoAction(cAIMoveEnactor *this, unsigned int cCreature *pCreature; // [esp+8h] [ebp-28h] sAIMoveGoal nullGoal; // [esp+Ch] [ebp-24h] BYREF - if ( cAIState::GetMode((cAIState *)this->m_pAIState) < kAIM_Efficient || !cAITimer::Expired(&this->m_ImpulsePeriod) ) + if ( cAIState::GetMode(this->m_pAIState) < kAIM_Efficient || !cAITimer::Expired(&this->m_ImpulsePeriod) ) return 0; - if ( cAIState::IsCreature((cAIState *)this->m_pAIState) ) + if ( cAIState::IsCreature(this->m_pAIState) ) { ID = cAIComponentBase::GetID(this); pCreature = j__CreatureFromObj(ID); @@ -320632,8 +320415,8 @@ int __thiscall cAIMoveEnactor::NonMotNoAction(cAIMoveEnactor *this, unsigned int { ++this->m_StandCount; sAIMoveGoal::sAIMoveGoal(&nullGoal); - nullGoal.dir = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value); - nullGoal.dest = *cAIState::GetLocation((cAIState *)this->m_pAIState); + nullGoal.dir = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &result)->value); + nullGoal.dest = *cAIState::GetLocation(this->m_pAIState); this->m_flags |= 2u; return cAIMoveEnactor::NonMotEnactMoveGoal(this, &nullGoal, deltaTime); } @@ -320684,9 +320467,9 @@ void __thiscall cAIMoveEnactor::CalculateTargetVel( mxs_vector dir; // [esp+10h] [ebp-10h] BYREF const cMxsVector *loc; // [esp+1Ch] [ebp-4h] - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); - cAIState::GetPathCell((cAIState *)this->m_pAIState); - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); + cAIState::GetPathCell(this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); mx_sub_vec(&dir, &goal->dest, Location); if ( mx_mag2_vec(&dir) > 0.0001 ) mx_normeq_vec(&dir); @@ -320754,17 +320537,17 @@ void __thiscall cAIMoveEnactor::CalculateImpulse( float desiredZ; // [esp+84h] [ebp-10h] mxs_vector vel; // [esp+88h] [ebp-Ch] BYREF - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); - cell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); + cell = cAIState::GetPathCell(this->m_pAIState); floatang::floatang(¤tFacing); floatang::floatang(&facingRelMoveDir); floatang::floatang(&delta); floatang::floatang(&goalFacing); floatang::floatang(&moveDir); floatang::floatang(&dirDiff); - if ( cAIState::GetMode((cAIState *)this->m_pAIState) <= kAIM_Efficient ) + if ( cAIState::GetMode(this->m_pAIState) <= kAIM_Efficient ) { - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); mx_sub_vec(&dir, &goal->dest, Location); if ( mx_mag2_vec(&dir) > 0.0001 ) mx_normeq_vec(&dir); @@ -320781,11 +320564,11 @@ void __thiscall cAIMoveEnactor::CalculateImpulse( { desiredZ = loc->z; } - v13 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v13 = cAIState::GetLocation(this->m_pAIState); X_4a = v13->z - desiredZ; if ( ffabsf(X_4a) >= 0.6 ) { - v15 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v15 = cAIState::GetLocation(this->m_pAIState); if ( v15->z <= (double)desiredZ ) dir.z = 0.60000002; else @@ -320793,7 +320576,7 @@ void __thiscall cAIMoveEnactor::CalculateImpulse( } else { - v14 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v14 = cAIState::GetLocation(this->m_pAIState); dir.z = desiredZ - v14->z; } ID = cAIComponentBase::GetID(this); @@ -320807,7 +320590,7 @@ void __thiscall cAIMoveEnactor::CalculateImpulse( } else { - currentFacing.value = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value; + currentFacing.value = cAIState::GetFacingAng(this->m_pAIState, &result)->value; v4 = cAIComponentBase::GetID(this); GetObjVelocity(v4, &vel); floatang::set(&moveDir, 0.0, 0.0, vel.x, vel.y); @@ -321354,7 +321137,7 @@ int __stdcall cAIMoveEnactor::ResetMotionTags(cAIMoveEnactor *this) if ( !this->m_pMotionCoord ) return 1; cTagSet::cTagSet(&tags); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( j__ObjGetActorTagList(ID, &actorTagList) ) { cTagSet::FromString(&tags, actorTagList->m_TagStrings); @@ -321372,11 +321155,11 @@ int __stdcall cAIMoveEnactor::ResetMotionTags(cAIMoveEnactor *this) int __thiscall cAIMoveEnactor::MotStatus(cAIMoveEnactor *this) { int ID; // eax - eAIMEStatus status; // [esp+4h] [ebp-4h] + eMCoordStatus status; // [esp+4h] [ebp-4h] status = this->m_pMotionCoord->GetStatus(this->m_pMotionCoord); ID = cAIComponentBase::GetID(this); - if ( !j__CreatureSelfPropelled(ID) && status == kAIME_ActiveBusy && cAITimer::Expired(&this->m_ImpulsePeriod) ) + if ( !j__CreatureSelfPropelled(ID) && status == kMCoord_ActiveBusy && cAITimer::Expired(&this->m_ImpulsePeriod) ) return 1; return status; } @@ -321387,7 +321170,7 @@ int __thiscall cAIMoveEnactor::MotNoAction(cAIMoveEnactor *this, unsigned int de int ID; // eax int v4; // eax const cTagSet *v5; // eax - int v6; // [esp+0h] [ebp-4Ch] + BOOL v6; // [esp+0h] [ebp-4Ch] int v7; // [esp+4h] [ebp-48h] cTagSet v9; // [esp+Ch] [ebp-40h] BYREF int v10; // [esp+14h] [ebp-38h] @@ -321399,7 +321182,7 @@ int __thiscall cAIMoveEnactor::MotNoAction(cAIMoveEnactor *this, unsigned int de sAIMoveGoal::sAIMoveGoal(&nullGoal); refreshBallistic = 0; - if ( cAIState::GetMode((cAIState *)this->m_pAIState) <= kAIM_Efficient ) + if ( cAIState::GetMode(this->m_pAIState) <= kAIM_Efficient ) return 0; status = cAIMoveEnactor::MotStatus(this); v7 = 0; @@ -321422,8 +321205,8 @@ int __thiscall cAIMoveEnactor::MotNoAction(cAIMoveEnactor *this, unsigned int de } if ( newStandGoal || refreshBallistic ) { - nullGoal.dir = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value); - nullGoal.dest = *cAIState::GetLocation((cAIState *)this->m_pAIState); + nullGoal.dir = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &result)->value); + nullGoal.dest = *cAIState::GetLocation(this->m_pAIState); } if ( newStandGoal ) { @@ -321451,7 +321234,7 @@ int __thiscall cAIMoveEnactor::MotEnact(cAIMoveEnactor *this, cAIMoveAction *pAc const sAIMoveGoal *MoveGoal; // eax const cTagSet *Tags; // [esp-8h] [ebp-Ch] - if ( cAIState::GetMode((cAIState *)this->m_pAIState) <= kAIM_Efficient ) + if ( cAIState::GetMode(this->m_pAIState) <= kAIM_Efficient ) return 1; this->m_flags &= ~2u; cAIRandomTimer::Force(&this->m_StandTimer); @@ -321539,7 +321322,7 @@ int __thiscall cAIMoveEnactor::MotEnactMoveGoal( v30 = (int)*cDABase>::operator[](&this->m_MoveRegulators, i); (*(void (__stdcall **)(int, const sAIMoveGoal *, sAIMoveGoal *))(*(_DWORD *)v30 + 188))(v30, inputGoal, &goal); } - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); sMcMoveParams::sMcMoveParams(¶ms); if ( config_spew_on && CfgSpewTest(aAienacttrace) ) CfgDoSpew(aMotenactmovego); @@ -321571,7 +321354,7 @@ int __thiscall cAIMoveEnactor::MotEnactMoveGoal( { y = tmp.y; x = tmp.x; - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d dest: %g, %g\n", v6, x, y); } mx_subeq_vec(&tmp, loc); @@ -321584,10 +321367,10 @@ int __thiscall cAIMoveEnactor::MotEnactMoveGoal( { v27 = tmp.y; v24 = tmp.x; - v22 = cAIState::GetID((cAIState *)this->m_pAIState); + v22 = cAIState::GetID(this->m_pAIState); v21 = loc->y; v20 = loc->x; - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d curp: %g, %g\n%d delt: %g, %g\n", v8, v20, v21, v22, v24, v27); } } @@ -321621,7 +321404,7 @@ int __thiscall cAIMoveEnactor::MotEnactMoveGoal( this->m_pMotionCoord->SetCurrentManeuver(this->m_pMotionCoord, pManeuver); if ( config_spew_on && CfgSpewTest(aCerebellumtrac) ) { - v15 = cAIState::GetID((cAIState *)this->m_pAIState); + v15 = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d: setting maneuver\n", v15); } operator delete(pPlan); @@ -321667,7 +321450,7 @@ int __thiscall cAIMoveEnactor::MotEnact(cAIMoveEnactor *this, cAIMotionAction *p sMcMoveParams params; // [esp+4Ch] [ebp-44h] BYREF const char *pszTagsProp; // [esp+8Ch] [ebp-4h] - if ( cAIState::GetMode((cAIState *)this->m_pAIState) <= kAIM_Efficient || pAction->cAIAction::Started(pAction) ) + if ( cAIState::GetMode(this->m_pAIState) <= kAIM_Efficient || pAction->cAIAction::Started(pAction) ) { if ( !cAITimer::Expired(&this->m_ImpulsePeriod) ) return 0; @@ -321682,8 +321465,8 @@ int __thiscall cAIMoveEnactor::MotEnact(cAIMoveEnactor *this, cAIMotionAction *p if ( cAIMotionAction::IsFacingSet(pAction) ) nullGoal.dir = LODWORD(cAIMotionAction::GetFacing(pAction)->value); else - nullGoal.dir = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value); - nullGoal.dest = *cAIState::GetLocation((cAIState *)this->m_pAIState); + nullGoal.dir = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &result)->value); + nullGoal.dest = *cAIState::GetLocation(this->m_pAIState); return cAIMoveEnactor::NonMotEnactMoveGoal(this, &nullGoal, deltaTime); } } @@ -321774,7 +321557,7 @@ int __thiscall cAIMoveEnactor::MotEnactMotion(cAIMoveEnactor *this, const sMcMov cAnsiStr::cAnsiStr(&tagString); cTagSet::ToString(¶ms->tags, &tagString); m_pchData = tagString.m_pchData; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("Unable to build motion plan for obj %d with tags {%s}\n", ID, m_pchData); cAnsiStr::~cAnsiStr(&tagString); return -2147467259; @@ -321861,7 +321644,7 @@ int __cdecl AIComputeWeightedBias(unsigned int kind, int baseBias) { int wieghtedBias; // [esp+4h] [ebp-4h] - if ( (unsigned int)baseBias >= 0x65 ) + if ( (unsigned int)baseBias > 0x64 ) _CriticalMsg(aInvalidMoveSug, aRPrjThief2Skup_1977, 0x34u); wieghtedBias = (kind != 4 ? 1 : -1) * (baseBias * (dword_9E2E9C[2 * kind] - g_BiasWeightings[kind].minWeight) / 100 @@ -321932,7 +321715,7 @@ void __stdcall cAINetwork::OnSimStart(cAINetwork *this) } //----- (00550990) -------------------------------------------------------- -void __cdecl cAIManager::handleTransferAI(int id, int size, void *pTransferData, cAIManager *pAIManager) +void __cdecl cAIManager::handleTransferAI(int id, unsigned int size, void *pTransferData, cAIManager *pAIManager) { sAINetTransfer transfer; // [esp+0h] [ebp-8h] BYREF @@ -322193,7 +321976,7 @@ void __thiscall cAIManager::NetworkMessageHandler(cAIManager *this, const sAINet } if ( !pAI->IsNetworkProxy(pAI) ) { - v6 = (cAIState *)pAI->GetState(pAI); + v6 = pAI->GetState(pAI); if ( !cAIState::IsBrainsOnly(v6) ) { DbgReportWarning("Network message to control AI: %d which is controlled here.\n", netmsg->aiObj); @@ -322731,7 +322514,7 @@ void __cdecl AIPhysRaycastSetObjFilter(eAIPRObjFilter filter) } else { - if ( (unsigned int)filter >= kAIPR_Any ) + if ( (unsigned int)filter > kAIPR_PathblockingOrPathable ) _CriticalMsg(aInvalidObjectF, aRPrjThief2Skup_1963, 0x19u); v2 = cDABase>::Size(&g_Filters[filter]); v1 = cDABase>::operator int *(&g_Filters[filter]); @@ -324058,7 +323841,7 @@ int __thiscall cAISoundEnactor::DoRequestConcept(cAISoundEnactor *this, sAISound time = j__GetSimTime(); if ( g_bSpeechDatabaseLoaded ) { - if ( cAIState::GetMode((cAIState *)this->m_pAIState) ) + if ( cAIState::GetMode(this->m_pAIState) ) { cTagSet::cTagSet(&tags); ID = cAIComponentBase::GetID(this); @@ -324194,7 +323977,7 @@ int __thiscall cAISoundEnactor::DoRequestConcept(cAISoundEnactor *this, sAISound &awarenesses, i); ObjLocation = GetObjLocation(**v17); - dist = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); + dist = cAIState::DistSq(this->m_pAIState, ObjLocation); if ( dist < 625.0 && dist < (double)friendDist ) { v19 = cAIComponentBase::GetID(this); @@ -324476,7 +324259,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 979D1C: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 979D2C: using guessed type void *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019; +// 979D2C: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019; //----- (005556B0) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -324490,7 +324273,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 979D1C: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 979D2C: using guessed type void *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019; +// 979D2C: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastProperty__3U_GUID__BPAUsAIBroadcastSettings__V__cHashPropertyStore_V__cClassDataOps_UsAIBroadcastSettings________6B__cUnknownProperty_UIAIBroadcastProperty___1_IID_IAIBroadcastPropedadcc019; //----- (00555720) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -324869,7 +324652,7 @@ sDatum *__stdcall cHashPropertyStore>::Creat sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -324883,7 +324666,6 @@ sDatum *__stdcall cHashPropertyStore>::Creat result->value = val.value; return result; } -// 555EF0: using guessed type char var_8[4]; //----- (00555FA0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -324923,7 +324705,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -324941,7 +324723,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -324949,7 +324731,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 556050: using guessed type char var_C[4]; //----- (00556130) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -324960,7 +324741,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -324969,7 +324750,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -324984,7 +324765,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5561C0: variable 'v5' is possibly undefined -// 556130: using guessed type char var_C[4]; //----- (00556200) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -325074,7 +324854,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -325089,7 +324869,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 556420: using guessed type char var_C[4]; //----- (005564B0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -325120,7 +324899,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -325133,7 +324912,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 556510: using guessed type char var_8[4]; //----- (005565A0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -325378,7 +325156,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -325406,7 +325184,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 556BF2: variable 'v4' is possibly undefined -// 556B50: using guessed type char var_10[4]; //----- (00556C50) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -325653,19 +325430,19 @@ int __stdcall cAIWallsCliffsMovReg::SuggestRegulations(cAIWallsCliffsMovReg *thi } ID = cAIComponentBase::GetID(this); pPos = j__ObjPosGet(ID); - cell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + cell = cAIState::GetPathCell(this->m_pAIState); if ( !pPos ) _CriticalMsg(aPpos, aRPrjThief2Skup_1953, 0x56u); floatang::floatang(&ang); for ( i = 0; i < 8; ++i ) { mx_rot_z_vec(&testPt, &dirVecs[i], pPos->fac.tz); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); mx_addeq_vec(&testPt, PathLocation); LODWORD(v14.value) = 0; LODWORD(v13.value) = 0; v12 = cell; - v5 = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + v5 = cAIState::GetPathLocation(this->m_pAIState); if ( !AIPathcast(v5, v12, &testPt, LOBYTE(v13.value), (IAIPathfindControl *)v14.value) ) { floatang::set(&ang, pPos->loc.vec.x, pPos->loc.vec.y, testPt.x, testPt.y); @@ -325795,13 +325572,13 @@ int __stdcall cAILVLMovReg::SuggestRegulations(cAILVLMovReg *this, cAIMoveSugges } ID = cAIComponentBase::GetID(this); pPos = j__ObjPosGet(ID); - cell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + cell = cAIState::GetPathCell(this->m_pAIState); if ( !pPos ) _CriticalMsg(aPpos_0, aRPrjThief2Skup_1956, 0x11Du); floatang::floatang(&ang); - if ( cAIState::GetCurrentPath((cAIState *)this->m_pAIState) ) + if ( cAIState::GetCurrentPath(this->m_pAIState) ) { - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); pCell = cAIPathDB::AccessCell(&g_AIPathDB, PathCell); if ( pCell ) { @@ -325812,7 +325589,7 @@ int __stdcall cAILVLMovReg::SuggestRegulations(cAILVLMovReg *this, cAIMoveSugges if ( (pLink->okBits & 0x10) != 0 ) { LODWORD(v12.value) = (floatang)pLink->dest; - CurrentPath = cAIState::GetCurrentPath((cAIState *)this->m_pAIState); + CurrentPath = cAIState::GetCurrentPath(this->m_pAIState); if ( !CurrentPath->IsCellInPath(CurrentPath, (unsigned int)v12.value) ) { if ( GetCellEdgeIntersection(&pPos->loc.vec, pLink->dest, 2.2, &testPt) ) @@ -326005,7 +325782,7 @@ double __cdecl CalcDist2ToEdge(const mxs_vector *pLocation, const mxs_vector *pP } else { - *(_QWORD *)&pIntersect->x = 0i64; + *(_QWORD *)&pIntersect->x = 0LL; return mx_mag2_vec(pLocation); } } @@ -326045,7 +325822,7 @@ int __stdcall cAIObjectsMovReg::SuggestRegulations(cAIObjectsMovReg *this, cAIMo const floatang *v8; // eax float v9; // ecx floatang v10; // [esp-4h] [ebp-48h] BYREF - float f; // [esp+0h] [ebp-44h] BYREF + floatang f; // [esp+0h] [ebp-44h] BYREF sAIMoveSuggestion *v12; // [esp+4h] [ebp-40h] floatang result; // [esp+8h] [ebp-3Ch] BYREF floatang v14; // [esp+10h] [ebp-34h] BYREF @@ -326063,7 +325840,7 @@ int __stdcall cAIObjectsMovReg::SuggestRegulations(cAIObjectsMovReg *this, cAIMo { cAITimer::Reset(&this->m_Timer); cAIMoveSuggestions::DestroyAll(&this->m_Suggestions); - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); self = cAIComponentBase::GetID(this); AIGetAllObjRepel(&pAvoidObjs, &nAvoidObjs); if ( pAvoidObjs ) @@ -326076,8 +325853,8 @@ int __stdcall cAIObjectsMovReg::SuggestRegulations(cAIObjectsMovReg *this, cAIMo { if ( GetObjLocation(pAvoidObjs[nAvoidObjs], &objLoc) ) { - f = objLoc.z - loc->z; - if ( ffabsf(f) < 3.0 ) + f.value = objLoc.z - loc->z; + if ( ffabsf(f.value) < 3.0 ) { v3 = AIXYDistance(loc, &objLoc); distance = v3; @@ -326097,12 +325874,12 @@ int __stdcall cAIObjectsMovReg::SuggestRegulations(cAIObjectsMovReg *this, cAIMo v5 = CalculateObjectBias(distance); sAIMoveSuggestion::SetWeightedBias(pSuggestion, 4u, v5); floatang::floatang(&v14, 0.95993108); - f = v6; - floatang::floatang((floatang *)&f, v7); - v8 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &objLoc); + f.value = v6; + floatang::floatang(&f, v7); + v8 = cAIState::AngleTo(this->m_pAIState, &result, &objLoc); v10.value = v9; floatang::floatang(&v10, v8); - floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, v10, LODWORD(f)); + floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, v10, f); pSuggestion->speed = kAIS_Normal; cDABase>::Append( &this->m_Suggestions, @@ -326313,7 +326090,7 @@ void __cdecl cDARawSrvFns::ConstructItem( void __cdecl AIInitStunAbility() { g_pAISupriseProp = j__CreateVectorProperty(&SupriseDesc, 1u); - *(_QWORD *)&defSupriseVec.x = 0x4234000042A00000i64; + *(_QWORD *)&defSupriseVec.x = 0x4234000042A00000LL; defSupriseVec.z = 7.0; lastSupriseTime = -8000; } @@ -326507,9 +326284,9 @@ void __stdcall cAIStun::OnAlertness( if ( pSupriseVec->x != 0.0 || pSupriseVec->y != 0.0 ) { pAwareness = this->m_pAI->GetAwareness(this->m_pAI, source); - if ( sAIAwareness::ValidLastPos((sAIAwareness *)pAwareness) ) + if ( sAIAwareness::ValidLastPos(pAwareness) ) { - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); v7 = mx_dist2_vec(&pAwareness->lastPos, Location); if ( pSupriseVec->z * pSupriseVec->z > v7 ) { @@ -326518,10 +326295,10 @@ void __stdcall cAIStun::OnAlertness( { y = pAwareness->lastPos.y; x = pAwareness->lastPos.x; - v10 = cAIState::GetLocation((cAIState *)this->m_pAIState)->y; - v8 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v10 = cAIState::GetLocation(this->m_pAIState)->y; + v8 = cAIState::GetLocation(this->m_pAIState); floatang::floatang(&ang, v8->x, v10, x, y); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &result); ang_diff = Delta(&v13, FacingAng, &ang)->value; if ( ang_diff <= 1.847995678582231 ) cAIStun::SetStunned(this, aDiscoverRecoil, 0, 0); @@ -326614,7 +326391,7 @@ void __stdcall cAIStun::OnGoalChange(cAIStun *this, const cAIGoal *pPrevious, co v13 = (sScrMsg *)j__new(0x38u, aRPrjThief2Skup_1951, 277); if ( v13 ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); sScrMsg::sScrMsg(v13, ID, aUnstun); v11 = v5; } @@ -326632,7 +326409,7 @@ void __stdcall cAIStun::OnGoalChange(cAIStun *this, const cAIGoal *pPrevious, co v12 = (sScrMsg *)j__new(0x38u, aRPrjThief2Skup_1952, 284); if ( v12 ) { - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); sScrMsg::sScrMsg(v12, v6, aStun); v9 = v7; } @@ -326865,7 +326642,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -326979,7 +326756,7 @@ void __cdecl AICloseTagBlock(ITagFile *pTagFile) } //----- (00559899) -------------------------------------------------------- -void __cdecl AITagMoveRaw(ITagFile *pTagFile, char *pData, int nBytes) +void __cdecl AITagMoveRaw(ITagFile *pTagFile, char *pData, unsigned int nBytes) { if ( pData ) pTagFile->Move(pTagFile, pData, nBytes); @@ -327147,7 +326924,7 @@ int __stdcall cAITriggeredPScripted::Save(cAITriggeredPScripted *this, ITagFile { int ID; // eax unsigned int m_SaveLoadSubtag; // [esp-10h] [ebp-18h] - int v5; // [esp+0h] [ebp-8h] + BOOL v5; // [esp+0h] [ebp-8h] int fActs; // [esp+4h] [ebp-4h] BYREF if ( this->m_SaveLoadSubtag ) @@ -327360,10 +327137,10 @@ int __cdecl GetXYIntersection( mxs_vector vec3; // [esp+20h] [ebp-44h] BYREF mxs_vector vec2; // [esp+2Ch] [ebp-38h] mxs_vector vec1; // [esp+38h] [ebp-2Ch] - long double slope3; // [esp+44h] [ebp-20h] - long double s; // [esp+4Ch] [ebp-18h] - long double slope2; // [esp+54h] [ebp-10h] - long double slope1; // [esp+5Ch] [ebp-8h] + double slope3; // [esp+44h] [ebp-20h] + double s; // [esp+4Ch] [ebp-18h] + double slope2; // [esp+54h] [ebp-10h] + double slope1; // [esp+5Ch] [ebp-8h] vec1.x = line1b->x - line1a->x; vec1.y = line1b->y - line1a->y; @@ -327521,7 +327298,7 @@ int __cdecl GetObjLocation(int obj, mxs_vector *p) else { LABEL_7: - *(_QWORD *)&p->el[1] = 0i64; + *(_QWORD *)&p->el[1] = 0LL; p->x = 0.0; return 0; } @@ -328462,9 +328239,9 @@ int __cdecl AIInitCombatHtoHAbility() g_pAIHtoHMotionResponse = j__CreateVectorProperty(&HtoHMotionResp, 3u); g_pAIHtoHGruntAlways = j__CreateBoolProperty(&HtoHGruntAlways, 3u); g_pAIHtoHModeOverride = j__CreateIntProperty(&HtoHModeOverride, 3u); - *(_QWORD *)&default_audio.x = 0x40E000003FC00000i64; + *(_QWORD *)&default_audio.x = 0x40E000003FC00000LL; default_audio.z = 1.5; - *(_QWORD *)&default_motion.x = 0x40E00000406CCCCDi64; + *(_QWORD *)&default_motion.x = 0x40E00000406CCCCDLL; default_motion.z = 1.6; return 1; } @@ -329043,7 +328820,6 @@ int __thiscall cAIHtoHSubcombat::CheckInterruptForEvent(cAIHtoHSubcombat *this, pSolution = 0; newCombatSound = -1; i = 0; -LABEL_2: while ( i < this->m_EventQueuePtr ) { ev = this->m_EventQueue[i++]; @@ -329226,7 +329002,7 @@ int __thiscall cAIHtoHSubcombat::CheckInterruptForEvent(cAIHtoHSubcombat *this, } break; default: - goto LABEL_2; + continue; } } } @@ -329252,7 +329028,7 @@ eMode __thiscall cAIHtoHSubcombat::ChooseNewAttackMode( int v7; // eax eAIRating v8; // eax float v; // [esp+0h] [ebp-3Ch] - int v11; // [esp+4h] [ebp-38h] + BOOL v11; // [esp+4h] [ebp-38h] float v12; // [esp+Ch] [ebp-30h] floatang result; // [esp+18h] [ebp-24h] BYREF Position *TargetPos; // [esp+1Ch] [ebp-20h] @@ -329267,8 +329043,8 @@ eMode __thiscall cAIHtoHSubcombat::ChooseNewAttackMode( weap_obj = j__GetWeaponObjID(target); imBehindTarget = 0; TargetPos = j__ObjPosGet(target); - v = cAIState::GetLocation((cAIState *)this->m_pAIState)->y; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + v = cAIState::GetLocation(this->m_pAIState)->y; + Location = cAIState::GetLocation(this->m_pAIState); floatang::floatang(&ang, targetLoc->x, targetLoc->y, Location->x, v); v12 = (double)(2 * TargetPos->fac.tz) * 3.141592653589793 / 65536.0; floatang::floatang(&plyfac, v12); @@ -329604,9 +329380,9 @@ void __thiscall cAIHtoHSubcombat::CacheVisualDamageTags(cAIHtoHSubcombat *this, ObjLocation = GetObjLocation(g_CollisionObj1, &pos); if ( ObjLocation ) { - v16 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &pos); + v16 = cAIState::AngleTo(this->m_pAIState, &result, &pos); floatang::floatang(&direction, v16); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v32); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v32); val = direction.value - FacingAng->value; if ( val < 0.0 ) val = val + 6.283185307179586; @@ -329615,7 +329391,7 @@ void __thiscall cAIHtoHSubcombat::CacheVisualDamageTags(cAIHtoHSubcombat *this, idx = (__int64)val; if ( g_AICbtWatchObj == -1 || cAIComponentBase::GetID(this) == g_AICbtWatchObj ) { - v18 = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v31); + v18 = cAIState::GetFacingAng(this->m_pAIState, &v31); v24 = direction.value - v18->value; value = direction.value; v22 = val; @@ -329723,7 +329499,7 @@ cAISeqAction *__thiscall cAIHtoHSubcombat::CreateFrustrationAction( cAISeqAction::Add(pSeqAction, pMotionAction); pMotionAction->Release(pMotionAction); } - v5 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, targetLoc); + v5 = cAIState::AngleTo(this->m_pAIState, &result, targetLoc); floatang::floatang(&direction, v5); if ( j__RandRange(1, 100) >= 10 ) { @@ -329920,10 +329696,10 @@ cAIAction *__thiscall cAIHtoHSubcombat::DoFrustration(cAIHtoHSubcombat *this, co pAI = (IInternalAI *)v29->GetAI(v29, v23); if ( pAI ) { - v10 = (cAIState *)pAI->GetState(pAI); + v10 = pAI->GetState(pAI); LOBYTE(nSwimBits) = cAIState::GetStressBits(v10) & 4; nSwimBits = (unsigned __int8)nSwimBits; - v11 = (cAIState *)pAI->GetState(pAI); + v11 = pAI->GetState(pAI); nAlertness = cAIState::GetAlertness(v11); if ( pAI ) pAI->Release(pAI); @@ -329935,12 +329711,12 @@ cAIAction *__thiscall cAIHtoHSubcombat::DoFrustration(cAIHtoHSubcombat *this, co } else { - startCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + startCell = cAIState::GetPathCell(this->m_pAIState); Pos = *pPos; cAILocoAction::StrokeDest(&Pos, &hintCell, FoundId); v28 = this->m_pAI->AccessPathfinder(this->m_pAI); v24 = v28->AccessControl(v28); - StressBits = cAIState::GetStressBits((cAIState *)this->m_pAIState); + StressBits = cAIState::GetStressBits(this->m_pAIState); pPath = AIPathfind(pOurPos, startCell, &Pos, 0, nSwimBits & StressBits | 0x11, v24); if ( pPath ) { @@ -330117,11 +329893,11 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( else { ++this->m_BackoffCount; - backang = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value; + backang = cAIState::GetFacingAng(this->m_pAIState, &result)->value; backoffSpot.x = cos(backang) * -4.9; backoffSpot.y = sin(backang) * -4.9; backoffSpot.z = 0.0; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); mx_addeq_vec(&backoffSpot, Location); v63 = ((int (__stdcall *)(IInternalAI *, mxs_vector *, int))this->m_pAI->AccessPathfinder)( this->m_pAI, @@ -330219,7 +329995,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( cTagSet::FromString(&tags, aMeleecombat0At_1); newCombatSound = 18; Xb = cAISubcombat::GetTargetInfo(this)->id; - v13 = cAIState::GetID((cAIState *)this->m_pAIState); + v13 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(2, v13, Xb, 3); } } @@ -330235,7 +330011,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( cTagSet::Add(&tags, v16); this->m_DoDirectionBlock = -1; Xe = cAISubcombat::GetTargetInfo(this)->id; - v17 = cAIState::GetID((cAIState *)this->m_pAIState); + v17 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(8, v17, Xe, 2); } else @@ -330268,7 +330044,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( cTagSet::FromString(&tags, aMeleecombat0Bl); cAIComponentBase::SetNotifications(this, 0x4000u); Xd = cAISubcombat::GetTargetInfo(this)->id; - v15 = cAIState::GetID((cAIState *)this->m_pAIState); + v15 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(8, v15, Xd, 2); break; case kSwingQuick: @@ -330278,7 +330054,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( if ( cAIHtoHSubcombat::CheckStat(this, v8, kNorm, 0.5) ) newCombatSound = 18; X = cAISubcombat::GetTargetInfo(this)->id; - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(2, v9, X, 1); break; case kSwingNormal: @@ -330288,14 +330064,14 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( if ( cAIHtoHSubcombat::CheckStat(this, v11, kHigh, 0.5) ) newCombatSound = 18; Xa = cAISubcombat::GetTargetInfo(this)->id; - v12 = cAIState::GetID((cAIState *)this->m_pAIState); + v12 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(2, v12, Xa, 2); break; case kSwingSpecial: cTagSet::FromString(&tags, aMeleecombat0At_2); newCombatSound = 18; Xc = cAISubcombat::GetTargetInfo(this)->id; - v14 = cAIState::GetID((cAIState *)this->m_pAIState); + v14 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(2, v14, Xc, 3); break; } @@ -330321,7 +330097,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( pAction = cAIActorBase::CreateMotionAction(this, 0); cAIAction::AddTags(pAction, &tags); TargetInfo = cAISubcombat::GetTargetInfo(this); - v19 = cAIState::AngleTo((cAIState *)this->m_pAIState, &v70, &TargetInfo->loc); + v19 = cAIState::AngleTo(this->m_pAIState, &v70, &TargetInfo->loc); floatang::floatang(&direction, v19); cAIMotionAction::SetFacing((cAIMotionAction *)pAction, &direction); v20 = cAISubcombat::GetTargetInfo(this); @@ -330423,7 +330199,7 @@ int __thiscall cAIHtoHSubcombat::SuggestActionsForMode( else { v37 = cAISubcombat::GetTargetInfo(this); - v38 = cAIState::AngleTo((cAIState *)this->m_pAIState, &v68, &v37->loc); + v38 = cAIState::AngleTo(this->m_pAIState, &v68, &v37->loc); floatang::floatang(&facing, v38); pMotionAction = cAIActorBase::CreateMotionAction(this, 0); if ( this->m_pAI->IsNetworkProxy(this->m_pAI) ) @@ -331039,24 +330815,24 @@ BOOL __thiscall cAIRangedBackup::CheckPreconditions(cAIRangedBackup *this) float backang; // [esp+48h] [ebp-4h] cMxsVector::cMxsVector(&destVec); - State = (cAIState *)cAIRangedMode::GetState(this); + State = cAIRangedMode::GetState(this); backang = cAIState::GetFacingAng(State, &result)->value; destVec.x = cos(backang) * -5.0; destVec.y = sin(backang) * -5.0; destVec.z = 0.0; - v2 = (cAIState *)cAIRangedMode::GetState(this); + v2 = cAIRangedMode::GetState(this); Location = cAIState::GetLocation(v2); mx_addeq_vec(&destVec, Location); destLoc.vec = destVec.mxs_vector; - v4 = (cAIState *)cAIRangedMode::GetState(this); + v4 = cAIRangedMode::GetState(this); if ( cAIState::GetPortalLocation(v4)->cell == -1 ) { - v5 = (cAIState *)cAIRangedMode::GetState(this); + v5 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v5)->hint; } else { - v6 = (cAIState *)cAIRangedMode::GetState(this); + v6 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v6)->cell; } destLoc.hint = hint; @@ -331181,24 +330957,24 @@ BOOL __thiscall cAIRangedClose::CheckStepForwardPreconditions(cAIRangedClose *th cMxsVector::cMxsVector(&destVec); cAIRangedLocation::cAIRangedLocation(&destAILoc, this->m_pOwner); - State = (cAIState *)cAIRangedMode::GetState(this); + State = cAIRangedMode::GetState(this); facing = cAIState::GetFacingAng(State, &result)->value; destVec.x = cos(facing) * 5.0; destVec.y = sin(facing) * 5.0; destVec.z = 0.0; - v2 = (cAIState *)cAIRangedMode::GetState(this); + v2 = cAIRangedMode::GetState(this); Location = cAIState::GetLocation(v2); mx_addeq_vec(&destVec, Location); destLoc.vec = destVec.mxs_vector; - v4 = (cAIState *)cAIRangedMode::GetState(this); + v4 = cAIRangedMode::GetState(this); if ( cAIState::GetPortalLocation(v4)->cell == -1 ) { - v5 = (cAIState *)cAIRangedMode::GetState(this); + v5 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v5)->hint; } else { - v6 = (cAIState *)cAIRangedMode::GetState(this); + v6 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v6)->cell; } destLoc.hint = hint; @@ -331484,7 +331260,7 @@ int __thiscall cAIRangedFlee::CheckPreconditions(cAIRangedFlee *this) unsigned int CellID; // eax float distance; // [esp+0h] [ebp-9Ch] floatang v14; // [esp+4h] [ebp-98h] BYREF - float v; // [esp+8h] [ebp-94h] + floatang *v; // [esp+8h] [ebp-94h] __int16 cell; // [esp+Eh] [ebp-8Eh] cAIRangedLocation *v17; // [esp+10h] [ebp-8Ch] void *v18; // [esp+14h] [ebp-88h] @@ -331542,9 +331318,9 @@ int __thiscall cAIRangedFlee::CheckPreconditions(cAIRangedFlee *this) floatang::floatang(&v34, v22); angle.value = v34.value; floatang::floatang(&a, 3.1415927); - LODWORD(v) = cAIRangedMode::GetTargetHeading(thisa, &result); + v = cAIRangedMode::GetTargetHeading(thisa, &result); v5 = operator+(&v31, &angle, &a); - angle.value = operator-(&v30, v5, (const floatang *)LODWORD(v))->value; + angle.value = operator-(&v30, v5, v)->value; if ( angle.value >= 0.0 ) { if ( angle.value > 0.0 ) @@ -331566,11 +331342,11 @@ int __thiscall cAIRangedFlee::CheckPreconditions(cAIRangedFlee *this) if ( angle.value > 6.283185307178 ) angle.value = 6.2831855; } - LODWORD(v) = &targetVec; + v = (floatang *)&targetVec; v14.value = v6; floatang::floatang(&v14, &angle); distance = pParams->m_distance + pParams->m_clearance; - ProjectFromLocationOnZPlane(&pMyLoc->vec, distance, v14, (mxs_vector *)LODWORD(v)); + ProjectFromLocationOnZPlane(&pMyLoc->vec, distance, v14, (mxs_vector *)v); targetLoc.vec = targetVec; if ( pMyLoc->cell == -1 ) hint = pMyLoc->hint; @@ -331628,10 +331404,10 @@ int __thiscall cAIRangedFlee::CheckPreconditions(cAIRangedFlee *this) } if ( found ) { - LODWORD(v) = &targetVec; + v = (floatang *)&targetVec; LODWORD(v14.value) = (floatang)&targetVec; floatang::floatang(&v14, &bestAngle); - ProjectFromLocationOnZPlane(&pMyLoc->vec, pParams->m_distance, v14, (mxs_vector *)LODWORD(v)); + ProjectFromLocationOnZPlane(&pMyLoc->vec, pParams->m_distance, v14, (mxs_vector *)v); targetLoc.vec = targetVec; if ( pMyLoc->cell == -1 ) cell = pMyLoc->hint; @@ -331641,9 +331417,9 @@ int __thiscall cAIRangedFlee::CheckPreconditions(cAIRangedFlee *this) targetLoc.cell = -1; cAIRangedLocation::SetLocation(thisa->m_pTargetAILoc, &targetLoc); cAIRangedLocation::TestPathcast(thisa->m_pTargetAILoc); - LODWORD(v) = &targetVec; + v = (floatang *)&targetVec; CellID = cAIRangedLocation::GetCellID(thisa->m_pTargetAILoc); - targetLoc.vec.z = cAIPathDB::GetZAtXY(&g_AIPathDB, CellID, (const mxs_vector *)LODWORD(v)) + 3.0; + targetLoc.vec.z = cAIPathDB::GetZAtXY(&g_AIPathDB, CellID, (const mxs_vector *)v) + 3.0; cAIRangedLocation::SetLocation(thisa->m_pTargetAILoc, &targetLoc); } return found; @@ -331676,7 +331452,7 @@ int __thiscall cAIRangedMode::GetID(cAIRangedMode *this) { cAIState *v1; // eax - v1 = (cAIState *)this->m_pOwner->m_pAI->GetState(this->m_pOwner->m_pAI); + v1 = this->m_pOwner->m_pAI->GetState(this->m_pOwner->m_pAI); return cAIState::GetID(v1); } @@ -331810,7 +331586,7 @@ cAIMoveAction *__thiscall cAIRangedIdle::SuggestAction(cAIRangedIdle *this) v9->speed = kAIS_Stopped; pSuggestion->facing.type = kAIF_SpecificDir; TargetLoc = cAIRangedMode::GetTargetLoc(thisa); - v3 = cAIState::AngleTo((cAIState *)thisa->m_pOwner->m_pAIState, &result, TargetLoc); + v3 = cAIState::AngleTo(thisa->m_pOwner->m_pAIState, &result, TargetLoc); v4 = pSuggestion; pSuggestion->facing.ang = v3->value; LODWORD(v8.value) = (floatang)v4; @@ -332025,7 +331801,7 @@ cAIAction *__thiscall cAIRangedMode::CreateMotionAction(cAIRangedMode *this, cha pAction = cAIActorBase::CreateMotionAction(this->m_pOwner, 0); cAIAction::AddTags(pAction, &tags); p_loc = &cAIRangedMode::GetTargetInfo(this)->loc; - State = (cAIState *)cAIRangedMode::GetState(this); + State = cAIRangedMode::GetState(this); v3 = cAIState::AngleTo(State, &result, p_loc); floatang::floatang(&direction, v3); cAIMotionAction::SetFacing((cAIMotionAction *)pAction, &direction); @@ -332104,8 +331880,8 @@ int InitRangedModeProperties() cAIRangedShootProperty *v7; // [esp+Ch] [ebp-18h] cAIRangedFleeProperty *v8; // [esp+10h] [ebp-14h] cAIRangedApplicabilitiesProperty *v9; // [esp+14h] [ebp-10h] - IUnknown *v10; // [esp+18h] [ebp-Ch] - IUnknown *Aggregated; // [esp+1Ch] [ebp-8h] + IStructDescTools *v10; // [esp+18h] [ebp-Ch] + IStructDescTools *Aggregated; // [esp+1Ch] [ebp-8h] IStructDescTools *tools; // [esp+20h] [ebp-4h] v9 = (cAIRangedApplicabilitiesProperty *)j__new(0xF0u, aRPrjThief2Skup_1929, 235); @@ -332134,10 +331910,8 @@ int InitRangedModeProperties() v5 = 0; } g_pAIRangedFleeProperty = v5; - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_AIRangedFleeSDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_AIRangedFleeSDesc); if ( Aggregated ) Aggregated->Release(Aggregated); v7 = (cAIRangedShootProperty *)j__new(0xF0u, aRPrjThief2Skup_1931, 241); @@ -332151,8 +331925,8 @@ int InitRangedModeProperties() v4 = 0; } g_pAIRangedShootProperty = v4; - v10 = _AppGetAggregated(&IID_IStructDescTools); - result = ((int (__stdcall *)(IUnknown *, sStructDesc *))v10->__vftable[5].QueryInterface)(v10, &g_AIRangedShootSDesc); + v10 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + result = v10->Register(v10, &g_AIRangedShootSDesc); if ( v10 ) return v10->Release(v10); return result; @@ -332306,7 +332080,7 @@ void __thiscall cSpecificPropertymStore); } // 97AB64: using guessed type void *cSpecificProperty>::`vftable'{for `cStoredProperty'}; -// 97AB74: using guessed type void *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0; +// 97AB74: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0; //----- (00564960) -------------------------------------------------------- void __thiscall cSpecificProperty>::~cSpecificProperty>( @@ -332320,7 +332094,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97AB64: using guessed type void *cSpecificProperty>::`vftable'{for `cStoredProperty'}; -// 97AB74: using guessed type void *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0; +// 97AB74: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIRangedApplicabilitiesProperty___1_IID_IAIRangedApplicabilitiesProperty__3U_GUID__BPAUsAIRangedApplicabilities__V__cHashPropertyStore_VcAIRangedApplicabilitiesOps______6B__cUnknownProperty_UIAIRangedApplicabilitiesPropera391faa0; //----- (005649D0) -------------------------------------------------------- int __stdcall cSpecificProperty>::Get( @@ -333385,7 +333159,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -333399,7 +333173,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5660C0: using guessed type char var_8[4]; //----- (00566170) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete( @@ -333439,7 +333212,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -333457,7 +333230,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRangedApplicabilitiesOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRangedApplicabilitiesOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -333465,7 +333238,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 566220: using guessed type char var_C[4]; //----- (00566300) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -333476,7 +333248,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -333485,7 +333257,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRangedApplicabilitiesOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRangedApplicabilitiesOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -333500,7 +333272,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 566390: variable 'v5' is possibly undefined -// 566300: using guessed type char var_C[4]; //----- (005663D0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset( @@ -333590,7 +333361,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -333602,7 +333373,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5665F0: using guessed type char var_C[4]; //----- (00566680) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion( @@ -333633,7 +333403,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -333643,7 +333413,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cAIRangedApplicabilitiesOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5666E0: using guessed type char var_8[4]; //----- (00566770) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -333734,7 +333503,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -333748,7 +333517,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 566910: using guessed type char var_8[4]; //----- (005669C0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -333784,7 +333552,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -333799,7 +333567,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRangedFleeOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRangedFleeOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -333807,7 +333575,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 566A70: using guessed type char var_C[4]; //----- (00566B50) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -333818,7 +333585,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -333827,7 +333594,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRangedFleeOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRangedFleeOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -333842,7 +333609,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 566BE0: variable 'v5' is possibly undefined -// 566B50: using guessed type char var_C[4]; //----- (00566C20) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -333931,7 +333697,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -333943,7 +333709,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 566E40: using guessed type char var_C[4]; //----- (00566ED0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -333967,7 +333732,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -333977,7 +333742,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 566F30: using guessed type char var_8[4]; //----- (00566FC0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -334068,7 +333832,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -334082,7 +333846,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 567160: using guessed type char var_8[4]; //----- (00567210) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -334118,7 +333881,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -334133,7 +333896,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRangedShootOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRangedShootOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -334141,7 +333904,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5672C0: using guessed type char var_C[4]; //----- (005673A0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -334152,7 +333914,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -334161,7 +333923,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRangedShootOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRangedShootOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -334176,7 +333938,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 567430: variable 'v5' is possibly undefined -// 5673A0: using guessed type char var_C[4]; //----- (00567470) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -334265,7 +334026,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -334277,7 +334038,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 567690: using guessed type char var_C[4]; //----- (00567720) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -334301,7 +334061,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -334311,7 +334071,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 567780: using guessed type char var_8[4]; //----- (00567810) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -334592,7 +334351,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -334620,7 +334379,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 567EFC: variable 'v4' is possibly undefined -// 567E60: using guessed type char var_10[4]; //----- (00567F60) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -334815,7 +334573,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -334843,7 +334601,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5683DC: variable 'v4' is possibly undefined -// 568340: using guessed type char var_10[4]; //----- (00568440) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -335040,7 +334797,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -335068,7 +334825,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5688BC: variable 'v4' is possibly undefined -// 568820: using guessed type char var_10[4]; //----- (00568920) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -335473,7 +335229,7 @@ void __stdcall cAINewRangedSubcombat::Init(cAINewRangedSubcombat *this) v31 = (cAIRangedLocation *)j__new(0x40u, aRPrjThief2Skup_1915, 183); if ( v31 ) { - PortalLocation = cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + PortalLocation = cAIState::GetPortalLocation(this->m_pAIState); cAIRangedLocation::cAIRangedLocation(v31, this, PortalLocation); v22 = v3; } @@ -335783,7 +335539,7 @@ void __stdcall cAINewRangedSubcombat::OnActionProgress(cAINewRangedSubcombat *th int v5; // [esp+0h] [ebp-10h] int v6; // [esp+4h] [ebp-Ch] int v7; // [esp+8h] [ebp-8h] - int re_eval; // [esp+Ch] [ebp-4h] + BOOL re_eval; // [esp+Ch] [ebp-4h] IAIAction *pActiona; // [esp+1Ch] [ebp+Ch] cAIComponentBase::OnActionProgress(this, pAction); @@ -335802,25 +335558,24 @@ void __stdcall cAINewRangedSubcombat::OnActionProgress(cAINewRangedSubcombat *th v6 = pActiona->GetType(pActiona); if ( v6 == 3 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Arrived at destination\n", ID, aRanged_17); } } - else if ( v6 == 16 - && (g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj) ) + else if ( v6 == 16 && (g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj) ) { - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Completed launch action\n", v2, aRanged_16); } re_eval = 1; } else if ( v7 == 3 && pActiona->GetType(pActiona) == 3 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Unable to pathfind\n", v4, aRanged_18); } cAISubcombat::SignalAction(this); @@ -335940,7 +335695,7 @@ void __thiscall cAINewRangedSubcombat::UpdateData(cAINewRangedSubcombat *this) { const Location *PortalLocation; // eax - PortalLocation = cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + PortalLocation = cAIState::GetPortalLocation(this->m_pAIState); cAIRangedLocation::SetLocation(this->m_pCurrentLocation, PortalLocation); cAIRangedLocation::TestRangeClass(this->m_pCurrentLocation); cAIRangedLocation::TestLOF(this->m_pCurrentLocation); @@ -335967,7 +335722,7 @@ int __stdcall cAINewRangedSubcombat::SuggestActions( const char *v15; // [esp-4h] [ebp-58h] const char *v16; // [esp-4h] [ebp-58h] const char *v17; // [esp-4h] [ebp-58h] - int v18; // [esp+0h] [ebp-54h] + BOOL v18; // [esp+0h] [ebp-54h] int v19; // [esp+4h] [ebp-50h] IAIAction *FrustrationAction; // [esp+Ch] [ebp-48h] BYREF IAIAction *item; // [esp+10h] [ebp-44h] BYREF @@ -336135,7 +335890,7 @@ void __thiscall cAINewRangedSubcombat::RefreshProjectilesTime(cAINewRangedSubcom Aggregated = (ILinkManager *)_AppGetAggregated(&IID_ILinkManager); cAutoIPtr::cAutoIPtr(&pLinkMan, Aggregated); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, v3, 0); AIProjRelListenerLock = 1; while ( !query->Done(query) ) @@ -336171,7 +335926,7 @@ void __thiscall cAINewRangedSubcombat::RefreshProjectilesProj(cAINewRangedSubcom Aggregated = (ILinkManager *)_AppGetAggregated(&IID_ILinkManager); cAutoIPtr::cAutoIPtr(&pLinkMan, Aggregated); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, v3, 0); AIProjRelListenerLock = 1; while ( !query->Done(query) ) @@ -336222,7 +335977,7 @@ void __thiscall cAINewRangedSubcombat::SelectProjectile( ILinkQuery *query; // [esp+44h] [ebp-4h] cDynArray::cDynArray(&selection_list); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); for ( query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, ID, 0); !query->Done(query); query->Next(query) ) { pProjData = (sAIProjectileRel *)query->Data(query); @@ -336230,7 +335985,7 @@ void __thiscall cAINewRangedSubcombat::SelectProjectile( if ( cAINewRangedSubcombat::ProjectileAvailable(this, pProjData) ) { v7 = cAINewRangedSubcombat::GetTargetInfo(this)->id; - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); if ( cAINewRangedSubcombat::ProjectileHittable(this, pProjData->targeting_method, link.dest, v5, v7, &targ_loc) >= 0 ) { sSelection::sSelection(&selection, link.dest, pProjData, targ_loc); @@ -336300,19 +336055,19 @@ int __thiscall cAINewRangedSubcombat::ProjectileHittable( return 0; if ( AIGetLaunchOffset(sourceID, &launchLoc) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v8 = j__ObjPosGet(ID); *(_QWORD *)&startLoc.vec.x = *(_QWORD *)&v8->loc.vec.x; startLoc.vec.z = v8->loc.vec.z; - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); if ( j__ObjPosGet(v9)->loc.cell == -1 ) { - v10 = cAIState::GetID((cAIState *)this->m_pAIState); + v10 = cAIState::GetID(this->m_pAIState); hint = j__ObjPosGet(v10)->loc.hint; } else { - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); hint = j__ObjPosGet(v11)->loc.cell; } startLoc.hint = hint; @@ -336410,7 +336165,7 @@ int __thiscall cAINewRangedSubcombat::ProjectileHittable( float tMax; // [esp+BCh] [ebp-64h] float fMag; // [esp+C0h] [ebp-60h] float gravityPct; // [esp+C4h] [ebp-5Ch] - int pData[3]; // [esp+C8h] [ebp-58h] BYREF + _DWORD pData[3]; // [esp+C8h] [ebp-58h] BYREF int hit_obj; // [esp+D4h] [ebp-4Ch] BYREF float fXVel; // [esp+D8h] [ebp-48h] sAIRangedCombatPhyscastData data; // [esp+DCh] [ebp-44h] BYREF @@ -336930,7 +336685,7 @@ int __cdecl AIInitRangedCombatAbility() g_pAIRangedWeaponLinks = j__CreateStandardRelation(&rangedWeaponDesc, &noDataDesc, 6u); g_pAIRangedAudioResponse = j__CreateVectorProperty(&RangedAudioResp, 3u); g_pAIRangedGruntAlways = j__CreateBoolProperty(&RangedGruntAlways, 3u); - *(_QWORD *)&default_audio_0.x = 0x40E000003FC00000i64; + *(_QWORD *)&default_audio_0.x = 0x40E000003FC00000LL; default_audio_0.z = 1.5; return 1; } @@ -337009,7 +336764,7 @@ void __stdcall cAIRangedSubcombat::Init(cAIRangedSubcombat *this) pRangedProp = cAIRangedSubcombat::GetRangedCombatProp(this); if ( !pRangedProp ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); g_pRangedCombatProp->Create(g_pRangedCombatProp, ID); pRangedProp = cAIRangedSubcombat::GetRangedCombatProp(this); } @@ -337019,7 +336774,7 @@ void __stdcall cAIRangedSubcombat::Init(cAIRangedSubcombat *this) } else { - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); v3 = _LogFmt("Initializing AI %d, but no ranged combat property?", v2); _CriticalMsg(v3, aRPrjThief2Skup_1906, 0xB4u); } @@ -337176,7 +336931,7 @@ void __stdcall cAIRangedSubcombat::OnActionProgress(cAIRangedSubcombat *this, IA int v6; // [esp+0h] [ebp-10h] int v7; // [esp+4h] [ebp-Ch] int v8; // [esp+8h] [ebp-8h] - int re_eval; // [esp+Ch] [ebp-4h] + BOOL re_eval; // [esp+Ch] [ebp-4h] IAIAction *pActiona; // [esp+1Ch] [ebp+Ch] cAIComponentBase::OnActionProgress(this, pAction); @@ -337195,9 +336950,9 @@ void __stdcall cAIRangedSubcombat::OnActionProgress(cAIRangedSubcombat *this, IA v7 = pActiona->GetType(pActiona); if ( v7 == 3 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Arrived at destination\n", ID, aRanged_1); } this->m_MoveStatus = kAtLoc; @@ -337206,9 +336961,9 @@ void __stdcall cAIRangedSubcombat::OnActionProgress(cAIRangedSubcombat *this, IA } else if ( v7 == 16 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Completed launch action\n", v2, aRanged_0); } this->m_MovingAttacking = 0; @@ -337221,10 +336976,10 @@ void __stdcall cAIRangedSubcombat::OnActionProgress(cAIRangedSubcombat *this, IA this->m_Attacking = 0; if ( pActiona->GetType(pActiona) == 3 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { m_CurDestPt = this->m_CurDestPt; - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Unable to pathfind to %d\n", v4, aRanged_2, m_CurDestPt); } this->m_CurDestScore = -10000.0; @@ -337362,9 +337117,9 @@ int __thiscall cAIRangedSubcombat::CheckReevaluateMove(cAIRangedSubcombat *this) { if ( this->m_DestinationScore > 0.0 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Destination is no longer good enough\n", ID, aRanged_3); } this->m_PointBiasList[0].objID = this->m_CurDestPt; @@ -337376,9 +337131,9 @@ int __thiscall cAIRangedSubcombat::CheckReevaluateMove(cAIRangedSubcombat *this) } if ( this->m_LocationScore != 0.0 && this->m_LocationScore * 0.5 <= this->m_CurLocScore ) return 0; - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Current location is no longer good enough\n", v3, aRanged_4); } this->m_PointBiasList[0].objID = this->m_CurMarkerPt; @@ -337412,9 +337167,9 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMarkerMoveLoc(cAIRangedSub kind = kAIRC_NoMove; if ( this->m_TacticalScore <= 0.0 ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Evaluating points (cover)\n", ID, aRanged_6); } g_pCoverPtProp->IterStart(g_pCoverPtProp, &iter); @@ -337435,9 +337190,9 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMarkerMoveLoc(cAIRangedSub } else { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Evaluating points (vantage)\n", v2, aRanged_5); } g_pVantagePtProp->IterStart(g_pVantagePtProp, &iter); @@ -337456,23 +337211,22 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMarkerMoveLoc(cAIRangedSub } } } - if ( best_score == -10000.0 - && (g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj) ) + if ( best_score == -10000.0 && (g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj) ) { - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] selected a REALLY BAD marker point\n", v6, aRanged_7); } if ( !best_marker || best_score < 0.0 ) return 0; this->m_CurDestPt = best_marker; this->m_DestinationScore = best_score; - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { m_CurDestPt = this->m_CurDestPt; - v7 = cAIState::GetID((cAIState *)this->m_pAIState); + v7 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Selected point %d\n", v7, aRanged_8, m_CurDestPt); } - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); query = g_pAIPtDibsRelation->Query(g_pAIPtDibsRelation, v8, 0); for ( i = query->Done(query); !i; i = query->Done(query) ) { @@ -337482,7 +337236,7 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMarkerMoveLoc(cAIRangedSub } if ( query ) query->Release(query); - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); g_pAIPtDibsRelation->Add(g_pAIPtDibsRelation, v11, best_marker); *pLoc = j__ObjPosGet(best_marker)->loc.vec; return kind; @@ -337529,13 +337283,13 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMoveLoc(cAIRangedSubcombat this->m_DestinationScore = 0.0; if ( cAIRangedSubcombat::HasTargetLOS(this) ) { - PortalLocation = cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + PortalLocation = cAIState::GetPortalLocation(this->m_pAIState); *(_QWORD *)&start.vec.x = *(_QWORD *)&PortalLocation->vec.x; start.vec.z = PortalLocation->vec.z; - if ( cAIState::GetPortalLocation((cAIState *)this->m_pAIState)->cell == -1 ) - hint = cAIState::GetPortalLocation((cAIState *)this->m_pAIState)->hint; + if ( cAIState::GetPortalLocation(this->m_pAIState)->cell == -1 ) + hint = cAIState::GetPortalLocation(this->m_pAIState)->hint; else - hint = cAIState::GetPortalLocation((cAIState *)this->m_pAIState)->cell; + hint = cAIState::GetPortalLocation(this->m_pAIState)->cell; start.hint = hint; start.cell = -1; TargetInfo = cAISubcombat::GetTargetInfo(this); @@ -337553,13 +337307,13 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMoveLoc(cAIRangedSubcombat v6 = cAISubcombat::GetTargetInfo(this); if ( hit_obj != v6->id ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Object in my way, sidestepping\n", ID, aRanged_10); } sidestep_left = j__Rand() % 2; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); mx_sub_vec(&to_target, &pTargetPos->loc.vec, Location); mx_unit_vec(&up, 2); mx_cross_vec(&sideways, &to_target, &up); @@ -337575,7 +337329,7 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMoveLoc(cAIRangedSubcombat { mx_scaleeq_vec(&sideways, sidestep_amt); } - v9 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v9 = cAIState::GetLocation(this->m_pAIState); mx_add_vec(&new_loc, v9, &sideways); v15 = ((int (__thiscall *)(IInternalAI *, IInternalAI *, mxs_vector *, int))this->m_pAI->AccessPathfinder)( this->m_pAI, @@ -337588,7 +337342,7 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMoveLoc(cAIRangedSubcombat } else { - v10 = cAIState::GetLocation((cAIState *)this->m_pAIState); + v10 = cAIState::GetLocation(this->m_pAIState); mx_sub_vec(&new_loc, v10, &sideways); v14 = ((int (__stdcall *)(IInternalAI *, mxs_vector *, int))this->m_pAI->AccessPathfinder)( this->m_pAI, @@ -337608,19 +337362,18 @@ eAIRCMoveLocKind __thiscall cAIRangedSubcombat::SelectMoveLoc(cAIRangedSubcombat } else { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { s = cAISubcombat::GetTargetInfo(this)->id; - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] No good enough points, advancing on %d\n", v3, aRanged_9, s); } *pLoc = *cAISubcombat::GetTargetLoc(this); kind = kAIRC_Target; } - if ( kind == kAIRC_NoMove - && (g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj) ) + if ( kind == kAIRC_NoMove && (g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj) ) { - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Current position is good enough, firing\n", v11, aRanged_11); } return kind; @@ -337727,9 +337480,9 @@ cAILocoAction *__thiscall cAIRangedSubcombat::CheckSuggestMoveAction( score = j__RandRange(0, 50); if ( score < max_score && this->m_CurLocScore > 100.0 && cAITimer::Expired(&this->m_FiringDelay) ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Pausing for attack\n", ID, aRanged_13); } this->m_MovingAttacking = 1; @@ -337767,9 +337520,9 @@ cAILocoAction *__thiscall cAIRangedSubcombat::CheckSuggestMoveAction( } else { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIRangedWatchObj ) { - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Cur location much better then destination\n", v3, aRanged_12); } this->m_MoveStatus = kAtLoc; @@ -337849,10 +337602,10 @@ cAIAction *__thiscall cAIRangedSubcombat::CheckSuggestAttackAction( cAIRangedSubcombat::SelectProjectile(thisa, &projectile, &proj_link_data, &targeting_location); if ( projectile ) { - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIRangedWatchObj ) { LODWORD(v17.value) = (floatang)projectile; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Launching projectile: %d\n", ID, aRanged_14, v17.value); } cAIRangedSubcombat::RefreshProjectilesProj(thisa, projectile); @@ -337994,10 +337747,10 @@ cAIMoveAction *__thiscall cAIRangedSubcombat::CheckSuggestIdleAction( thisa = this; if ( this->m_Attacking ) _CriticalMsg(aMAttacking, aRPrjThief2Skup_1909, 0x3D6u); - if ( g_AIRangedWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIRangedWatchObj ) + if ( g_AIRangedWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIRangedWatchObj ) { LODWORD(v10.value) = (floatang)aRanged_15; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Idling\n", ID, aRanged_15); } pMoveAction = cAIActorBase::CreateMoveAction(thisa, 0); @@ -338016,7 +337769,7 @@ cAIMoveAction *__thiscall cAIRangedSubcombat::CheckSuggestIdleAction( v11->speed = kAIS_Stopped; pSuggestion->facing.type = kAIF_SpecificDir; TargetLoc = cAISubcombat::GetTargetLoc(thisa); - v5 = cAIState::AngleTo((cAIState *)thisa->m_pAIState, &result, TargetLoc); + v5 = cAIState::AngleTo(thisa->m_pAIState, &result, TargetLoc); v6 = pSuggestion; pSuggestion->facing.ang = v5->value; LODWORD(v10.value) = (floatang)v6; @@ -338050,7 +337803,7 @@ int __stdcall cAIRangedSubcombat::SuggestActions( pRangedProp = cAIRangedSubcombat::GetRangedCombatProp(this); if ( !pRangedProp ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v5 = _LogFmt("Ranged combat AI (%d) w/o ranged combat property!\n", ID); _CriticalMsg(v5, aRPrjThief2Skup_1911, 0x3F6u); } @@ -338084,7 +337837,7 @@ void __thiscall cAIRangedSubcombat::RefreshProjectilesTime(cAIRangedSubcombat *t Aggregated = (ILinkManager *)_AppGetAggregated(&IID_ILinkManager); cAutoIPtr::cAutoIPtr(&pLinkMan, Aggregated); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, v3, 0); AIProjRelListenerLock = 1; while ( !query->Done(query) ) @@ -338120,7 +337873,7 @@ void __thiscall cAIRangedSubcombat::RefreshProjectilesProj(cAIRangedSubcombat *t Aggregated = (ILinkManager *)_AppGetAggregated(&IID_ILinkManager); cAutoIPtr::cAutoIPtr(&pLinkMan, Aggregated); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, v3, 0); AIProjRelListenerLock = 1; while ( !query->Done(query) ) @@ -338180,12 +337933,12 @@ void __thiscall cAIRangedSubcombat::DecayLocation(cAIRangedSubcombat *this) else { m_CurMarkerPt = this->m_CurMarkerPt; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v2 = _LogFmt("AI (%d) moving to point (%d) w/o vantage or cover prop!", ID, m_CurMarkerPt); _CriticalMsg(v2, aRPrjThief2Skup_1912, 0x453u); } } - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); if ( g_pRangedCombatProp->Get(g_pRangedCombatProp, v3, &pRangedProp) ) { ai_decay = pRangedProp->decay_speed; @@ -338196,7 +337949,7 @@ void __thiscall cAIRangedSubcombat::DecayLocation(cAIRangedSubcombat *this) } else { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); v5 = _LogFmt("AI (%d) w/o ranged combat property!", v4); _CriticalMsg(v5, aRPrjThief2Skup_1913, 0x459u); } @@ -338247,7 +338000,7 @@ void __thiscall cAIRangedSubcombat::EvalCurLocation(cAIRangedSubcombat *this) { const cMxsVector *Location; // eax - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); this->m_CurLocScore = cAIRangedSubcombat::EvaluateLoc(this, this->m_CurMarkerPt, Location) * this->m_CurLocDecayAmt; } @@ -338272,7 +338025,7 @@ void __thiscall cAIRangedSubcombat::SelectProjectile( ILinkQuery *query; // [esp+44h] [ebp-4h] cDynArray::cDynArray(&selection_list); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); for ( query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, ID, 0); !query->Done(query); query->Next(query) ) { pProjData = (sAIProjectileRel *)query->Data(query); @@ -338280,7 +338033,7 @@ void __thiscall cAIRangedSubcombat::SelectProjectile( if ( cAIRangedSubcombat::ProjectileAvailable(this, pProjData) ) { v7 = cAISubcombat::GetTargetInfo(this)->id; - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); if ( cAIRangedSubcombat::ProjectileHittable(this, pProjData->targeting_method, link.dest, v5, v7, &targ_loc) ) { sSelection::sSelection(&selection, link.dest, pProjData, targ_loc); @@ -338423,9 +338176,9 @@ BOOL __thiscall cAIRangedSubcombat::ProjectileHittable( mx_normeq_vec(&dir); v7 = mx_dist_vec(target_loc, source_loc); offset_size = 100.0 / v7 * offset_size; - *(_QWORD *)&offset[0].x = 0i64; + *(_QWORD *)&offset[0].x = 0LL; offset[0].z = offset_size; - *(_QWORD *)&offset[1].x = 0i64; + *(_QWORD *)&offset[1].x = 0LL; offset[1].z = -offset_size; mx_cross_vec(&offset[2], &dir, offset); mx_normeq_vec(&offset[2]); @@ -338541,7 +338294,7 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int __int16 hint; // [esp+2Ah] [ebp-9Eh] double v16; // [esp+2Ch] [ebp-9Ch] mxs_vector targeting_location; // [esp+38h] [ebp-90h] BYREF - char v19[4]; // [esp+44h] [ebp-84h] BYREF + _BYTE v19[4]; // [esp+44h] [ebp-84h] BYREF int projectile; // [esp+48h] [ebp-80h] sAIProjectileRel *pProjData; // [esp+50h] [ebp-78h] sCoverPtProp *pCoverPt; // [esp+54h] [ebp-74h] BYREF @@ -338580,7 +338333,7 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int if ( query ) query->Release(query); query = 0; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( link.source != ID ) return -10000.0; } @@ -338608,7 +338361,7 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int min_dist = (float)pAICombatProp->minimum_distance; no_los_bonus = -50.0; } - ai_loc = (mxs_vector *)cAIState::GetLocation((cAIState *)this->m_pAIState); + ai_loc = (mxs_vector *)cAIState::GetLocation(this->m_pAIState); targ_loc = cAISubcombat::GetTargetLoc(this); pt_targ_dist_2 = mx_dist2_vec(pt_loc, targ_loc); if ( min_dist * min_dist > pt_targ_dist_2 ) @@ -338643,7 +338396,7 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int score = score + no_los_bonus; } hittable = 0; - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); for ( query = g_pAIProjectileRelation->Query(g_pAIProjectileRelation, v11, 0); !query->Done(query) && !hittable; query->Next(query) ) @@ -338667,7 +338420,7 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int else { X = cAISubcombat::GetTarget(this); - v13 = cAIState::GetID((cAIState *)this->m_pAIState); + v13 = cAIState::GetID(this->m_pAIState); if ( cAIRangedSubcombat::ProjectileHittable( this, pProjData->targeting_method, @@ -338692,7 +338445,6 @@ double __thiscall cAIRangedSubcombat::EvaluateLoc(cAIRangedSubcombat *this, int } return score; } -// 56F251: using guessed type char var_84[4]; //----- (0056F6CF) -------------------------------------------------------- sAIRangedCombatProp *__thiscall cAIRangedSubcombat::GetRangedCombatProp(cAIRangedSubcombat *this) @@ -338701,7 +338453,7 @@ sAIRangedCombatProp *__thiscall cAIRangedSubcombat::GetRangedCombatProp(cAIRange sAIRangedCombatProp **p_m_RangedCombatProp; // [esp-4h] [ebp-8h] p_m_RangedCombatProp = &this->m_RangedCombatProp; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( g_pRangedCombatProp->Get(g_pRangedCombatProp, ID, p_m_RangedCombatProp) ) return this->m_RangedCombatProp; else @@ -339074,25 +338826,25 @@ int __thiscall cAIRangedStepLeft::CheckPreconditions(cAIRangedStepLeft *this) mxs_vector destVec; // [esp+7Ch] [ebp-10h] BYREF float backang; // [esp+88h] [ebp-4h] - State = (cAIState *)cAIRangedMode::GetState(this); + State = cAIRangedMode::GetState(this); backang = cAIState::GetFacingAng(State, &result)->value; cAIRangedLocation::cAIRangedLocation(&AIDestLoc, this->m_pOwner); destVec.x = sin(backang) * -5.0; destVec.y = cos(backang) * 5.0; destVec.z = 0.0; - v2 = (cAIState *)cAIRangedMode::GetState(this); + v2 = cAIRangedMode::GetState(this); Location = cAIState::GetLocation(v2); mx_addeq_vec(&destVec, Location); destLoc.vec = destVec; - v4 = (cAIState *)cAIRangedMode::GetState(this); + v4 = cAIRangedMode::GetState(this); if ( cAIState::GetPortalLocation(v4)->cell == -1 ) { - v5 = (cAIState *)cAIRangedMode::GetState(this); + v5 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v5)->hint; } else { - v6 = (cAIState *)cAIRangedMode::GetState(this); + v6 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v6)->cell; } destLoc.hint = hint; @@ -339146,25 +338898,25 @@ int __thiscall cAIRangedStepRight::CheckPreconditions(cAIRangedStepRight *this) mxs_vector destVec; // [esp+7Ch] [ebp-10h] BYREF float backang; // [esp+88h] [ebp-4h] - State = (cAIState *)cAIRangedMode::GetState(this); + State = cAIRangedMode::GetState(this); backang = cAIState::GetFacingAng(State, &result)->value; cAIRangedLocation::cAIRangedLocation(&AIDestLoc, this->m_pOwner); destVec.x = sin(backang) * 5.0; destVec.y = cos(backang) * -5.0; destVec.z = 0.0; - v2 = (cAIState *)cAIRangedMode::GetState(this); + v2 = cAIRangedMode::GetState(this); Location = cAIState::GetLocation(v2); mx_addeq_vec(&destVec, Location); destLoc.vec = destVec; - v4 = (cAIState *)cAIRangedMode::GetState(this); + v4 = cAIRangedMode::GetState(this); if ( cAIState::GetPortalLocation(v4)->cell == -1 ) { - v5 = (cAIState *)cAIRangedMode::GetState(this); + v5 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v5)->hint; } else { - v6 = (cAIState *)cAIRangedMode::GetState(this); + v6 = cAIRangedMode::GetState(this); hint = cAIState::GetPortalLocation(v6)->cell; } destLoc.hint = hint; @@ -339658,7 +339410,7 @@ void __stdcall cAICombat::Init(cAICombat *this) cAIRandomTimer::Delay(&this->m_LostContactTimer, 0x7FFFFFFFu); this->m_LostContactWith = 0; cAIComponentBase::SetNotifications(this, 0x8AD20u); - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); j__AddMotionFlagListener(v4, 0x20u, 0); } @@ -339667,7 +339419,7 @@ void __stdcall cAICombat::Term(cAICombat *this) { int ID; // eax - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); j__RemoveMotionFlagListener(ID, 0x20u); } @@ -339740,14 +339492,14 @@ void __stdcall cAICombat::OnActionProgress(cAICombat *this, IAIAction *pAction) oldTarget = cAICombat::GetTarget(this); if ( cAICombat::SeekCombat(this) ) { - if ( cAIState::GetMode((cAIState *)this->m_pAIState) >= kAIM_Combat ) + if ( cAIState::GetMode(this->m_pAIState) >= kAIM_Combat ) { if ( !this->InControl(this) || cAICombat::GetTarget(this) != oldTarget ) cAIAbility::SignalGoal(this); goto LABEL_11; } } - else if ( cAIState::GetMode((cAIState *)this->m_pAIState) != kAIM_Combat ) + else if ( cAIState::GetMode(this->m_pAIState) != kAIM_Combat ) { LABEL_11: cAITimer::Reset(&this->m_TargetRefreshTimer); @@ -339759,7 +339511,7 @@ void __stdcall cAICombat::OnActionProgress(cAICombat *this, IAIAction *pAction) LABEL_12: if ( cAIAbility::IsOwn(this, pAction) ) { - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) == kAIAL_High + if ( cAIState::GetAlertness(this->m_pAIState) == kAIAL_High && ((int (__thiscall *)(IInternalAI *, IInternalAI *))this->m_pAI->AccessSoundEnactor)(this->m_pAI, this->m_pAI) ) { v2 = ((int (__thiscall *)(IInternalAI *, IInternalAI *, int, _DWORD))this->m_pAI->AccessSoundEnactor)( @@ -339959,12 +339711,12 @@ int __thiscall cAICombat::GetTarget(cAICombat *this) const mxs_vector *__thiscall cAICombat::GetTargetLoc(cAICombat *this) { int target; // [esp+4h] [ebp-8h] - sAIAwareness *pAwareness; // [esp+8h] [ebp-4h] + const sAIAwareness *pAwareness; // [esp+8h] [ebp-4h] target = cAICombat::GetTarget(this); if ( !target ) _CriticalMsg(aCannotGetTarge, aRPrjThief2Skup_1898, 0x1FCu); - pAwareness = (sAIAwareness *)this->m_pAI->GetAwareness(this->m_pAI, target); + pAwareness = this->m_pAI->GetAwareness(this->m_pAI, target); if ( (pAwareness->flags & 4) != 0 ) { GetObjLocation(target, &result); @@ -339975,7 +339727,7 @@ const mxs_vector *__thiscall cAICombat::GetTargetLoc(cAICombat *this) } else { - result = cAIState::GetLocation((cAIState *)this->m_pAIState)->mxs_vector; + result = cAIState::GetLocation(this->m_pAIState)->mxs_vector; } return &result; } @@ -340023,7 +339775,7 @@ BOOL __thiscall cAICombat::IsValidTarget(cAICombat *this, int object) } //----- (0057272F) -------------------------------------------------------- -BOOL __thiscall cAICombat::IsAcquirableTarget(cAICombat *this, sAIAwareness *awareness) +BOOL __thiscall cAICombat::IsAcquirableTarget(cAICombat *this, const sAIAwareness *awareness) { int ID; // eax unsigned int v3; // esi @@ -340033,7 +339785,7 @@ BOOL __thiscall cAICombat::IsAcquirableTarget(cAICombat *this, sAIAwareness *awa int thresh; // [esp+10h] [ebp-4h] object = awareness->object; - thresh = cAIState::GetAlertness((cAIState *)this->m_pAIState) < this->m_targetAlertnessThreshold ? 3 : 1; + thresh = cAIState::GetAlertness(this->m_pAIState) < this->m_targetAlertnessThreshold ? 3 : 1; ID = cAIComponentBase::GetID(this); v6 = 0; if ( !g_pAIAttackLinks->GetSingleLink(g_pAIAttackLinks, ID, object) @@ -340059,7 +339811,7 @@ eAIPriority __thiscall cAICombat::TargetPriority(cAICombat *this, int object) eAIPriority priority; // [esp+8h] [ebp-4h] ObjLocation = GetObjLocation(object); - distSq = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); + distSq = cAIState::DistSq(this->m_pAIState, ObjLocation); if ( distSq <= 900.0 ) { if ( distSq >= 225.0 ) @@ -340089,7 +339841,7 @@ int __thiscall cAICombat::TargetScan(cAICombat *this) cDynArray awarenesses; // [esp+14h] [ebp-Ch] BYREF int target; // [esp+1Ch] [ebp-4h] - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) > kAIAL_Lowest ) + if ( cAIState::GetAlertness(this->m_pAIState) > kAIAL_Lowest ) { cDynArray::cDynArray(&awarenesses); v5 = ((int (__stdcall *)(IInternalAI *, cDynArray *))this->m_pAI->AccessSenses)( @@ -340144,7 +339896,7 @@ int __thiscall cAICombat::SelectTarget(cAICombat *this) int current; // [esp+48h] [ebp-8h] int time_this_target; // [esp+4Ch] [ebp-4h] - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) < kAIAL_Moderate ) + if ( cAIState::GetAlertness(this->m_pAIState) < kAIAL_Moderate ) return 0; cDynArray_::cDynArray_(&targets); current = cAICombat::GetTarget(this); @@ -340170,7 +339922,7 @@ int __thiscall cAICombat::SelectTarget(cAICombat *this) v4 = (eAIPriority *)pLinkQuery->Data(pLinkQuery); cDABase>::operator[](&targets, i)->priority = *v4; ObjLocation = GetObjLocation(link.dest); - v9 = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); + v9 = cAIState::DistSq(this->m_pAIState, ObjLocation); cDABase>::operator[](&targets, i)->distSq = v9; if ( cDABase>::operator[](&targets, i)->distSq < 25.0 ) { @@ -340259,11 +340011,11 @@ BOOL __thiscall cAICombat::IsRetainableTarget(cAICombat *this, const sAIAwarenes BOOL result; // eax BOOL v6; // [esp+4h] [ebp-18h] float distSq; // [esp+10h] [ebp-Ch] - int awareOfTarget; // [esp+14h] [ebp-8h] + BOOL awareOfTarget; // [esp+14h] [ebp-8h] awareOfTarget = awareness->level > kAIAL_Lowest; ObjLocation = GetObjLocation(awareness->object); - distSq = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); + distSq = cAIState::DistSq(this->m_pAIState, ObjLocation); v6 = (awareness->flags & 4) != 0 && distSq < 256.0; result = 1; if ( !v6 ) @@ -340319,7 +340071,7 @@ void __thiscall cAICombat::UpdateTargets(cAICombat *this) } //----- (00572F09) -------------------------------------------------------- -int __thiscall cAICombat::IsHostileToward(cAICombat *this, int obj) +BOOL __thiscall cAICombat::IsHostileToward(cAICombat *this, int obj) { int ID; // eax eAITeam v3; // eax @@ -340328,7 +340080,7 @@ int __thiscall cAICombat::IsHostileToward(cAICombat *this, int obj) eAITeam v7; // [esp-4h] [ebp-1Ch] BOOL v8; // [esp+0h] [ebp-18h] BOOL v9; // [esp+4h] [ebp-14h] - int result; // [esp+14h] [ebp-4h] + BOOL result; // [esp+14h] [ebp-4h] ID = cAIComponentBase::GetID(this); v7 = j___AIGetTeam(ID); @@ -340504,7 +340256,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 97BEBC: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97BECC: using guessed type void *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165; +// 97BECC: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165; //----- (005739D0) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -340518,7 +340270,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97BEBC: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97BECC: using guessed type void *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165; +// 97BECC: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingProperty__3U_GUID__BPAUsAICombatTiming__V__cHashPropertyStore_V__cClassDataOps_UsAICombatTiming________6B__cUnknownProperty_UIAICombatTimingProperty___1_IID_IAICombatTimingPro1d038165; //----- (00573A40) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -340885,7 +340637,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -340899,7 +340651,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 574190: using guessed type char var_8[4]; //----- (00574240) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -340939,7 +340690,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -340957,7 +340708,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -340965,7 +340716,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5742F0: using guessed type char var_C[4]; //----- (005743D0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -340976,7 +340726,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -340985,7 +340735,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -341000,7 +340750,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 574460: variable 'v5' is possibly undefined -// 5743D0: using guessed type char var_C[4]; //----- (005744A0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -341090,7 +340839,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -341105,7 +340854,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5746C0: using guessed type char var_C[4]; //----- (00574750) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -341136,7 +340884,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -341146,7 +340894,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5747B0: using guessed type char var_8[4]; //----- (00574840) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -341396,7 +341143,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -341424,7 +341171,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 574EAC: variable 'v4' is possibly undefined -// 574E10: using guessed type char var_10[4]; //----- (00574F10) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -341645,7 +341391,7 @@ void __thiscall cAIDevice::SetState(cAIDevice *this, int state) { if ( CfgSpewTest(aDevicespew_2) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Deactivated\n", ID); } } @@ -341654,12 +341400,12 @@ void __thiscall cAIDevice::SetState(cAIDevice *this, int state) this->m_state = state; if ( config_spew_on && CfgSpewTest(aDevicespew_1) ) { - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Activated\n", v6); } break; case 2: - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); pParams = AIGetProperty(g_pAIDeviceProperty, v2, &g_AIDefaultDeviceParams); if ( cAIDevice::IsValidJoint(this, pParams->m_jointActivate) ) this->m_state = state; @@ -341667,12 +341413,12 @@ void __thiscall cAIDevice::SetState(cAIDevice *this, int state) this->cAIDevice::SetState(this, 1); if ( config_spew_on && CfgSpewTest(aDevicespew) ) { - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Activating\n", v3); } break; case 3: - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); v10 = AIGetProperty(g_pAIDeviceProperty, v4, &g_AIDefaultDeviceParams); if ( cAIDevice::IsValidJoint(this, v10->m_jointActivate) ) this->m_state = state; @@ -341680,12 +341426,12 @@ void __thiscall cAIDevice::SetState(cAIDevice *this, int state) this->cAIDevice::SetState(this, 0); if ( config_spew_on && CfgSpewTest(aDevicespew_0) ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Deactivating\n", v5); } break; default: - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); DbgReportWarning("cAIDevice::SetState: bad state %d for AI %d\n", state, v8); break; } @@ -341694,13 +341440,13 @@ void __thiscall cAIDevice::SetState(cAIDevice *this, int state) //----- (005755D8) -------------------------------------------------------- BOOL __thiscall cAIDevice::ReadyToDeactivate(cAIDevice *this) { - return cAIState::GetAlertness((cAIState *)this->m_pAIState) <= kAIAL_Low && this->m_state; + return cAIState::GetAlertness(this->m_pAIState) <= kAIAL_Low && this->m_state; } //----- (00575611) -------------------------------------------------------- BOOL __thiscall cAIDevice::ReadyToActivate(cAIDevice *this) { - return cAIState::GetAlertness((cAIState *)this->m_pAIState) >= kAIAL_High && this->m_state != 1; + return cAIState::GetAlertness(this->m_pAIState) >= kAIAL_High && this->m_state != 1; } //----- (0057564A) -------------------------------------------------------- @@ -341807,25 +341553,25 @@ void __stdcall cAIDevice::OnActionProgress(cAIDevice *this, IAIAction *pAction) cAICombat::OnActionProgress(this, pAction); if ( cAIAbility::IsOwn(this, pAction) && pAction->GetResult(pAction) == kAIR_Success ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); pParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); v10 = pAction->GetType(pAction); if ( v10 == 65537 ) { if ( config_spew_on && CfgSpewTest(aDevicespew_4) ) { - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Finished rotate\n", v6); } if ( pParams->m_activateRotate ) { if ( !cAIDevice::IsValidJoint(this, pParams->m_jointActivate) ) _CriticalMsg(aIsvalidjointPp_0, aRPrjThief2Skup_1887, 0xDBu); - v7 = cAIState::GetID((cAIState *)this->m_pAIState); + v7 = cAIState::GetID(this->m_pAIState); if ( (unsigned int)(__int64)(j__ObjJointPos(v7)[pParams->m_jointActivate] - pParams->m_activePos + 0.5) || this->m_state != 2 ) { - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); if ( !(unsigned int)(__int64)(j__ObjJointPos(v8)[pParams->m_jointActivate] - pParams->m_inactivePos + 0.5) && this->m_state == 3 ) { @@ -341842,20 +341588,20 @@ void __stdcall cAIDevice::OnActionProgress(cAIDevice *this, IAIAction *pAction) { if ( !cAIDevice::IsValidJoint(this, pParams->m_jointActivate) ) _CriticalMsg(aIsvalidjointPp, aRPrjThief2Skup_1886, 0xC3u); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); if ( j__ObjJointPos(v3)[pParams->m_jointActivate] == pParams->m_activePos ) { this->cAIDevice::SetState(this, 1); } else { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); if ( j__ObjJointPos(v4)[pParams->m_jointActivate] == pParams->m_inactivePos ) this->cAIDevice::SetState(this, 0); } if ( config_spew_on && CfgSpewTest(aDevicespew_3) ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Finished slide\n", v5); } } @@ -341863,7 +341609,7 @@ void __stdcall cAIDevice::OnActionProgress(cAIDevice *this, IAIAction *pAction) { if ( CfgSpewTest(aDevicespew_5) ) { - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Finished fire\n", v9); } } @@ -341903,7 +341649,7 @@ int __thiscall cAIDevice::ShouldChangeFacing(cAIDevice *this) target = cAICombat::GetTarget(this); if ( !target ) return 0; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v3 = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); floatang::floatang(&b, v3->m_facingEpsilon); v4 = cAIDevice::FacingDelta(this, &result, target); @@ -341936,15 +341682,15 @@ floatang *__thiscall cAIDevice::FacingDelta(cAIDevice *this, floatang *result, i if ( __$ReturnUdt ) { targetLoc = j__ObjPosGet(__$ReturnUdt)->loc.vec; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(ID); - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); v6 = AIGetProperty(g_pAIDeviceProperty, v5, &g_AIDefaultDeviceParams); v = jointPos[v6->m_jointRotate] * 6.283185307178 / 360.0; floatang::floatang(&v17, v); jointAng.value = v17.value; - targetAng.value = cAIState::AngleTo((cAIState *)this->m_pAIState, &v16, &targetLoc)->value; - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v15); + targetAng.value = cAIState::AngleTo(this->m_pAIState, &v16, &targetLoc)->value; + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v15); v8 = operator+(&v14, FacingAng, &jointAng); v9 = Delta(&v13, v8, &targetAng); v10 = fabs(v9->value); @@ -342011,7 +341757,7 @@ int __thiscall cAIDevice::ActiveSuggestActions( if ( !target ) return 0; LODWORD(v11.value) = (floatang)&g_AIDefaultDeviceParams; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); pParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); if ( !cAIDevice::IsValidJoint(thisa, pParams->m_jointRotate) ) return 0; @@ -342042,7 +341788,7 @@ int __thiscall cAIDevice::ActiveSuggestActions( { if ( CfgSpewTest(aDevicespew_6) ) { - v10 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v10 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting rotate action\n", v10); } } @@ -342072,7 +341818,7 @@ int __thiscall cAIDevice::ActivateSuggestActions( const floatang *v15; // eax int v16; // eax int v17; // eax - float v; // [esp+0h] [ebp-70h] BYREF + floatang v; // [esp+0h] [ebp-70h] BYREF floatang v19; // [esp+4h] [ebp-6Ch] BYREF float v20; // [esp+8h] [ebp-68h] float v21; // [esp+Ch] [ebp-64h] @@ -342118,7 +341864,7 @@ int __thiscall cAIDevice::ActivateSuggestActions( } } LODWORD(v19.value) = (floatang)&g_AIDefaultDeviceParams; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); pParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); if ( !cAIDevice::IsValidJoint(thisa, pParams->m_jointActivate) ) _CriticalMsg(aIsvalidjointPp_1, aRPrjThief2Skup_1889, 0x157u); @@ -342138,19 +341884,19 @@ int __thiscall cAIDevice::ActivateSuggestActions( v19.value = v10; floatang::floatang(&v19, 0.0087266462); m_activePos = pParams->m_activePos; - FacingAng = cAIState::GetFacingAng((cAIState *)thisa->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(thisa->m_pAIState, &result); v13 = FacingAng->value * 360.0 / 6.283185307178 + m_activePos; v21 = v13; v20 = v13 * 6.283185307178 / 360.0; floatang::floatang(&v32, v20); - v = v14; - floatang::floatang((floatang *)&v, v15); - cAIJointRotateAction::Set(pRotateAction, pParams->m_jointActivate, LODWORD(v), v19); + v.value = v14; + floatang::floatang(&v, v15); + cAIJointRotateAction::Set(pRotateAction, pParams->m_jointActivate, v, v19); v30 = pRotateAction; cDABase>::Append(pNew, &v30); if ( config_spew_on && CfgSpewTest(aDevicespew_8) ) { - v16 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v16 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting rotate activate action\n", v16); } } @@ -342172,15 +341918,15 @@ int __thiscall cAIDevice::ActivateSuggestActions( cDABase>::Append(pNew, &item); if ( config_spew_on && CfgSpewTest(aDevicespew_7) ) { - v9 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v9 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting raise action\n", v9); } } cTagSet::cTagSet(&tagSet, aEventActivate); LODWORD(v19.value) = 0; - v = 0.0; - v17 = cAIState::GetID((cAIState *)thisa->m_pAIState); - ESndPlayObj(&tagSet, v17, 0, (sSchemaCallParams *)LODWORD(v), (void *)v19.value); + LODWORD(v.value) = 0; + v17 = cAIState::GetID(thisa->m_pAIState); + ESndPlayObj(&tagSet, v17, 0, (sSchemaCallParams *)v.value, (void *)v19.value); v29 = 0; cTagSet::~cTagSet(&tagSet); return v29; @@ -342280,12 +342026,12 @@ int __thiscall cAIDevice::DeactivateSuggestActions( return 0; } LODWORD(v[1]) = &g_AIDefaultDeviceParams; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); pParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); - v9 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v9 = cAIState::GetID(thisa->m_pAIState); jointPos = j__ObjJointPos(v9); LODWORD(v[1]) = &g_AIDefaultDeviceParams; - v10 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v10 = cAIState::GetID(thisa->m_pAIState); v11 = AIGetProperty(g_pAIDeviceProperty, v10, &g_AIDefaultDeviceParams); v35 = jointPos[v11->m_jointRotate] * 6.283185307178 / 360.0; floatang::floatang(&v50, v35); @@ -342311,7 +342057,7 @@ int __thiscall cAIDevice::DeactivateSuggestActions( v[1] = v20; floatang::floatang((floatang *)&v[1], 0.0087266462); m_inactivePos = pParams->m_inactivePos; - FacingAng = cAIState::GetFacingAng((cAIState *)thisa->m_pAIState, &v42); + FacingAng = cAIState::GetFacingAng(thisa->m_pAIState, &v42); v23 = FacingAng->value * 360.0 / 6.283185307178 + m_inactivePos; v30 = v23; v29 = v23 * 6.283185307178 / 360.0; @@ -342323,7 +342069,7 @@ int __thiscall cAIDevice::DeactivateSuggestActions( cDABase>::Append(pNew, &v41); if ( config_spew_on && CfgSpewTest(aDevicespew_11) ) { - v26 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v26 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting rotate deactivate action\n", v26); } } @@ -342345,14 +342091,14 @@ int __thiscall cAIDevice::DeactivateSuggestActions( cDABase>::Append(pNew, &v45); if ( config_spew_on && CfgSpewTest(aDevicespew_10) ) { - v19 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v19 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting lower action\n", v19); } } cTagSet::cTagSet(&tagSet, aEventDeactivat); v[1] = 0.0; v[0] = 0.0; - v27 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v27 = cAIState::GetID(thisa->m_pAIState); ESndPlayObj(&tagSet, v27, 0, (sSchemaCallParams *)LODWORD(v[0]), (void *)LODWORD(v[1])); cTagSet::~cTagSet(&tagSet); } @@ -342372,7 +342118,7 @@ int __thiscall cAIDevice::DeactivateSuggestActions( thisa->m_pRotateAction = v34; LODWORD(v[1]) = v14; floatang::floatang((floatang *)&v[1], pParams->m_facingEpsilon); - v15 = cAIState::GetFacingAng((cAIState *)thisa->m_pAIState, &result); + v15 = cAIState::GetFacingAng(thisa->m_pAIState, &result); v[0] = v16; floatang::floatang((floatang *)v, v15); cAIJointRotateAction::Set(thisa->m_pRotateAction, pParams->m_jointRotate, LODWORD(v[0]), LODWORD(v[1])); @@ -342380,7 +342126,7 @@ int __thiscall cAIDevice::DeactivateSuggestActions( cDABase>::Append(pNew, &item); if ( config_spew_on && CfgSpewTest(aDevicespew_9) ) { - v17 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v17 = cAIState::GetID(thisa->m_pAIState); CfgDoSpew("[%d] Starting rotate to zero action\n", v17); } } @@ -342432,7 +342178,7 @@ int __stdcall cAIDevice::GetRotateJoint(cAIDevice *this) { int ID; // eax - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); return AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams)->m_jointRotate; } @@ -342468,7 +342214,7 @@ sAICombatTacticalRanges *__cdecl AIGetTacticalRanges(int id) if ( default_dists.x == 0.0 ) { - *(_QWORD *)&default_dists.x = 0x40ECCCCD4099999Ai64; + *(_QWORD *)&default_dists.x = 0x40ECCCCD4099999ALL; default_dists.z = 10.2; } dists = &default_dists; @@ -342703,7 +342449,7 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) IAISenses *pSenses; // [esp+B4h] [ebp-8h] const cMxsVector *loc; // [esp+B8h] [ebp-4h] - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); memset(this->m_pTargetInfo, 0, sizeof(sAITargetInfo)); this->m_pTargetInfo->id = cAICombat::GetTarget(this); if ( !this->m_pTargetInfo->id ) @@ -342722,7 +342468,7 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) flags = this->m_pTargetInfo->flags; LOBYTE(flags) = flags & 0xFE; this->m_pTargetInfo->flags = flags; - if ( sAIAwareness::ValidLastPos((sAIAwareness *)this->m_pTargetInfo->pAwareness) ) + if ( sAIAwareness::ValidLastPos(this->m_pTargetInfo->pAwareness) ) { p_lastPos = &this->m_pTargetInfo->pAwareness->lastPos; p_loc = &this->m_pTargetInfo->loc; @@ -342744,11 +342490,11 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) } else { - this->m_pTargetInfo->distSq = cAIState::DistSq((cAIState *)this->m_pAIState, &this->m_pTargetInfo->loc); + this->m_pTargetInfo->distSq = cAIState::DistSq(this->m_pAIState, &this->m_pTargetInfo->loc); floatang::floatang(&v30, loc->x, loc->y, this->m_pTargetInfo->loc.x, this->m_pTargetInfo->loc.y); this->m_pTargetInfo->targetHeading.value = *v6; fa = &this->m_pTargetInfo->targetHeading; - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &result); this->m_pTargetInfo->targetHeadingDelta = LODWORD(Delta(&v28, FacingAng, fa)->value); floatang::floatang(&b, 1.5707964); if ( operator>(&this->m_pTargetInfo->targetHeadingDelta, &b) ) @@ -342761,10 +342507,10 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) v8 = cAIComponentBase::GetID(this); pRanges = AIGetTacticalRanges(v8); targetCell = AIFindClosestCell(&this->m_pTargetInfo->loc, 0, this->m_pTargetInfo->id, 0); - if ( targetCell && cAIState::GetPathCell((cAIState *)this->m_pAIState) ) + if ( targetCell && cAIState::GetPathCell(this->m_pAIState) ) { - fb = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + fb = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); zAI = AIGetZAtXYOnCell(PathLocation, fb); v10 = AIGetZAtXYOnCell(&this->m_pTargetInfo->loc, targetCell); zTarg = v10; @@ -342811,7 +342557,7 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) { if ( scaleVal * pRanges->Huge * (scaleVal * pRanges->Huge) <= this->m_pTargetInfo->distSq ) { - *(_QWORD *)&v2.x = 0i64; + *(_QWORD *)&v2.x = 0LL; v2.z = 1.0; v17 = j__mx_dot_vec(&delta_pos, &v2); scaleVal = 1.0 - fabs(v17); @@ -342846,7 +342592,7 @@ int __thiscall cAIMultiCombat::GatherTargetInfo(cAIMultiCombat *this) } else { - *(_QWORD *)&ZVec.x = 0i64; + *(_QWORD *)&ZVec.x = 0LL; ZVec.z = 1.0; v16 = j__mx_dot_vec(&delta_pos, &ZVec); scaleVal = 1.0 - fabs(v16); @@ -343006,21 +342752,21 @@ void __stdcall cAITurret::OnActionProgress(cAITurret *this, IAIAction *pAction) { int ID; // eax int v3; // eax - int firePause; // [esp+4h] [ebp-4h] + eAITimerPeriod firePause; // [esp+4h] [ebp-4h] cAIDevice::OnActionProgress(this, pAction); if ( pAction->GetResult(pAction) == kAIR_Success && pAction->GetType(pAction) == 65540 ) { cAIAbility::SignalAction(this); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); firePause = AIGetProperty(g_pAITurretProperty, ID, &g_AIDefaultTurretParams)->m_firePause; if ( firePause > 0 ) - cAITimer::Set(&this->m_fireTimer, (eAITimerPeriod)firePause); + cAITimer::Set(&this->m_fireTimer, firePause); if ( config_spew_on ) { if ( CfgSpewTest(aTurretspew) ) { - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Finished fire\n", v3); } } @@ -343037,10 +342783,10 @@ BOOL __thiscall cAITurret::CheckPitch(cAITurret *this, int targetID) float pitchEpsilon; // [esp+8h] [ebp-8h] float pitch; // [esp+Ch] [ebp-4h] - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); pitchEpsilon = AIGetProperty(g_pAITurretProperty, ID, &g_AIDefaultTurretParams)->m_pitchEpsilon; v3 = j__ObjPosGet(targetID); - v4 = cAIState::PitchTo((cAIState *)this->m_pAIState, &v3->loc.vec) * 180.0 / 3.141592653589793; + v4 = cAIState::PitchTo(this->m_pAIState, &v3->loc.vec) * 180.0 / 3.141592653589793; v6 = 0; if ( v4 <= pitchEpsilon ) { @@ -343099,7 +342845,7 @@ int __thiscall cAITurret::CheckLOF(cAITurret *this, int targetID, int subModel) data.sourceID = cAIComponentBase::GetID(this); data.targetID = targetID; j__PhysRaycastSetCallback((int (__cdecl *)(int, const cPhysModel *, void *))AITurretPhyscastCallback, &data); - start = *cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + start = *cAIState::GetPortalLocation(this->m_pAIState); result = j__PhysRaycast(&start, &targetLoc, &hitLoc, &hitObjID, 0.0, 263) == 0; j__PhysRaycastClearCallback(); return result; @@ -343125,8 +342871,8 @@ int __thiscall cAITurret::CheckRange(cAITurret *this, int targetID) float maxRangeSqa; // [esp+10h] [ebp-4h] ObjLocation = GetObjLocation(targetID); - distSq = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + distSq = cAIState::DistSq(this->m_pAIState, ObjLocation); + ID = cAIState::GetID(this->m_pAIState); maxRangeSq = AIGetProperty(g_pAITurretProperty, ID, &g_AIDefaultTurretParams)->m_maxRange; optRangeSqa = maxRangeSq / 2.0; maxRangeSqa = maxRangeSq * maxRangeSq; @@ -343227,27 +342973,27 @@ int __stdcall cAITurret::SuggestActions(cAITurret *this, cAIGoal *pGoal, const c return 0; if ( this->cAIDevice::GetDeviceState(this) != 1 ) return 0; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); pDeviceParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); - v10 = cAIState::GetID((cAIState *)this->m_pAIState); + v10 = cAIState::GetID(this->m_pAIState); pTurretParams = AIGetProperty(g_pAITurretProperty, v10, &g_AIDefaultTurretParams); target = cAICombat::GetTarget(this); if ( !target ) return -2147467259; targetLoc = j__ObjPosGet(target)->loc.vec; - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(v11); v = jointPos[pDeviceParams->m_jointRotate] * 6.283185307178 / 360.0; floatang::floatang(&v28, v); jointAng.value = v28.value; - v12 = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + v12 = cAIState::GetFacingAng(this->m_pAIState, &result); facingAng.value = operator+(&v26, v12, &jointAng)->value; - targetAng.value = cAIState::AngleTo((cAIState *)this->m_pAIState, &v25, &targetLoc)->value; + targetAng.value = cAIState::AngleTo(this->m_pAIState, &v25, &targetLoc)->value; v13 = Delta(&v23, &facingAng, &targetAng); v15 = fabs(v13->value); floatang::floatang(&v24, v15); deltaAng.value = v24.value; - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) < kAIAL_High ) + if ( cAIState::GetAlertness(this->m_pAIState) < kAIAL_High ) return 0; pAwareness = this->m_pAI->GetAwareness(this->m_pAI, target); if ( cAITimer::Expired(&this->m_fireTimer) ) @@ -343272,7 +343018,7 @@ int __stdcall cAITurret::SuggestActions(cAITurret *this, cAIGoal *pGoal, const c { if ( CfgSpewTest(aTurretspew_0) ) { - v14 = cAIState::GetID((cAIState *)this->m_pAIState); + v14 = cAIState::GetID(this->m_pAIState); CfgDoSpew("[%d] Fire\n", v14); } } @@ -343403,7 +343149,7 @@ int __stdcall cAICamera::SuggestGoal(cAICamera *this, cAIGoal *pPrevious, cAIGoa int v5; // [esp+0h] [ebp-Ch] cAIInvestigateGoal *v6; // [esp+4h] [ebp-8h] - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) >= kAIAL_Moderate ) + if ( cAIState::GetAlertness(this->m_pAIState) >= kAIAL_Moderate ) cAIDevice::SuggestGoal(this, pPrevious, ppNew); if ( !*ppNew ) { @@ -343499,9 +343245,9 @@ int __stdcall cAICamera::SuggestActions(cAICamera *this, cAIGoal *pGoal, const c cAIJointScanAction *v9; // eax float v10; // ecx float v11; // ecx - float v12; // [esp+4h] [ebp-5Ch] BYREF - float v13; // [esp+8h] [ebp-58h] BYREF - float v; // [esp+Ch] [ebp-54h] BYREF + floatang v12; // [esp+4h] [ebp-5Ch] BYREF + floatang v13; // [esp+8h] [ebp-58h] BYREF + floatang v; // [esp+Ch] [ebp-54h] BYREF floatang v15; // [esp+10h] [ebp-50h] BYREF float v16; // [esp+18h] [ebp-48h] float v17; // [esp+1Ch] [ebp-44h] @@ -343542,13 +343288,13 @@ int __stdcall cAICamera::SuggestActions(cAICamera *this, cAIGoal *pGoal, const c } return cAIDevice::SuggestActions(this, pGoal, previous, pNew); } - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) >= kAIAL_Moderate ) + if ( cAIState::GetAlertness(this->m_pAIState) >= kAIAL_Moderate ) return cAIDevice::SuggestActions(this, pGoal, previous, pNew); LODWORD(v15.value) = (floatang)&g_AIDefaultDeviceParams; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); pDeviceParams = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams); LODWORD(v15.value) = (floatang)&g_AIDefaultCameraParams; - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); pCameraParams = AIGetProperty(g_pAICameraProperty, v8, &g_AIDefaultCameraParams); v24 = (cAIJointScanAction *)j__new(0x58u, aRPrjThief2Skup_1881, 171); if ( v24 ) @@ -343565,15 +343311,15 @@ int __stdcall cAICamera::SuggestActions(cAICamera *this, cAIGoal *pGoal, const c LODWORD(v15.value) = (floatang)pCameraParams; floatang::floatang(&v15, v19); v18 = pCameraParams->m_scanSpeed * 6.283185307178 / 360.0; - v = v10; - floatang::floatang((floatang *)&v, v18); + v.value = v10; + floatang::floatang(&v, v18); v17 = pCameraParams->m_scanAngle2 * 6.283185307178 / 360.0; - v13 = v11; - floatang::floatang((floatang *)&v13, v17); + v13.value = v11; + floatang::floatang(&v13, v17); v16 = pCameraParams->m_scanAngle1 * 6.283185307178 / 360.0; - LODWORD(v12) = pCameraParams; - floatang::floatang((floatang *)&v12, v16); - cAIJointScanAction::Set(v26, pDeviceParams->m_jointRotate, LODWORD(v12), LODWORD(v13), LODWORD(v), v15); + LODWORD(v12.value) = (floatang)pCameraParams; + floatang::floatang(&v12, v16); + cAIJointScanAction::Set(v26, pDeviceParams->m_jointRotate, v12, v13, v, v15); item = v26; cDABase>::Append(pNew, &item); return 0; @@ -343612,7 +343358,7 @@ void __thiscall cAICamera::BroadcastSwitches(cAICamera *this) Aggregated = (IScriptMan *)_AppGetAggregated(&IID_IScriptMan); cAutoIPtr::cAutoIPtr(&pScriptMan, Aggregated); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); cAutoLinkQuery::cAutoLinkQuery(&query, g_pAICameraLinks, ID, 0); while ( 1 ) { @@ -343630,7 +343376,7 @@ void __thiscall cAICamera::BroadcastSwitches(cAICamera *this) cMultiParm::cMultiParm(&v18, pData->m_data[0]); v7 = pData; dest = slink.dest; - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); v10 = cIPtr::operator->(&pScriptMan); v10->PostMessage2(v10, v3, dest, v7->m_msg, &v18, &v19, &v20, 0); cMultiParm::~cMultiParm(&v18); @@ -343643,7 +343389,7 @@ void __thiscall cAICamera::BroadcastSwitches(cAICamera *this) cMultiParm::cMultiParm(&v16, 0); cMultiParm::cMultiParm(&v15, 0); v6 = slink.dest; - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); v9 = cIPtr::operator->(&pScriptMan); v9->PostMessage2(v9, v4, v6, 0, &v15, &v16, &v17, 0); cMultiParm::~cMultiParm(&v15); @@ -344079,7 +343825,7 @@ eAIResult __stdcall cAIFollowAction::Enact(cAIFollowAction *this, unsigned int d LODWORD(v13.value) = (floatang)&followObjVel; floatang::floatang(&v13, &followObjFacing); CalcTarget(&followObjLoc, v13, p_followObjVel, v15, v16, v17.value, (mxs_vector *)v18.value); - distSq = cAIState::DistXYSq((cAIState *)this->m_pAIState, ¤tLoc); + distSq = cAIState::DistXYSq(this->m_pAIState, ¤tLoc); if ( distSq < (double)bestSq ) { v20 = ((int (__thiscall *)(IInternalAI *, IInternalAI *, mxs_vector *, int))this->m_pAI->AccessPathfinder)( @@ -344108,13 +343854,13 @@ eAIResult __stdcall cAIFollowAction::Enact(cAIFollowAction *this, unsigned int d v19 = 0; } pSuggestion = v19; - if ( cAIState::DistSq((cAIState *)this->m_pAIState, &targetLoc) >= 4.0 ) + if ( cAIState::DistSq(this->m_pAIState, &targetLoc) >= 4.0 ) { sAIMoveSuggestion::SetWeightedBias(pSuggestion, 1u, 100); floatang::floatang(&v22, 5.6548667); v18.value = v9; floatang::floatang(&v18, v10); - v11 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &targetLoc); + v11 = cAIState::AngleTo(this->m_pAIState, &result, &targetLoc); v17.value = v12; floatang::floatang(&v17, v11); floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, v17, v18); @@ -344587,7 +344333,7 @@ eAIResult __stdcall cAIInvestAction::Enact(cAIInvestAction *this, unsigned int d const floatang *FacingAng; // eax floatang *v6; // eax floatang v7; // [esp-4h] [ebp-24h] BYREF - int v8; // [esp+0h] [ebp-20h] + __int32 v8; // [esp+0h] [ebp-20h] floatang v9; // [esp+8h] [ebp-18h] BYREF floatang v10; // [esp+Ch] [ebp-14h] BYREF floatang result; // [esp+10h] [ebp-10h] BYREF @@ -344616,7 +344362,7 @@ eAIResult __stdcall cAIInvestAction::Enact(cAIInvestAction *this, unsigned int d { case 0: Dest = cAILocoAction::GetDest(this->m_pLocoAction); - v4 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, Dest); + v4 = cAIState::AngleTo(this->m_pAIState, &result, Dest); floatang::floatang(&angleTo, v4); if ( this->m_pOrientAction ) { @@ -344625,7 +344371,7 @@ eAIResult __stdcall cAIInvestAction::Enact(cAIInvestAction *this, unsigned int d this->m_pOrientAction) ) { LODWORD(v7.value) = (floatang)&angleTo; - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v10); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v10); v6 = Delta(&v9, FacingAng, &angleTo); if ( ffabsf(v6->value) <= 0.78539816339725 ) { @@ -344859,7 +344605,7 @@ void __thiscall cAIJointRotateAction::Set(cAIJointRotateAction *this, int jointI this->m_jointID = jointID; this->m_targetID = targetID; v4 = j__ObjPosGet(this->m_targetID); - this->m_targetAng = LODWORD(cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &v4->loc.vec)->value); + this->m_targetAng = LODWORD(cAIState::AngleTo(this->m_pAIState, &result, &v4->loc.vec)->value); this->m_epsilonAng = epsilonAng; Aggregated = (IObjectSystem *)_AppGetAggregated(&IID_IObjectSystem); cAutoIPtr::cAutoIPtr(&pObjSys, Aggregated); @@ -344901,7 +344647,7 @@ void __thiscall cAIJointRotateAction::StartRotateSchema(cAIJointRotateAction *th callParams.flags = flags; callParams.callback = (void (__cdecl *)(int, int, void *))SchemaEndCallback; callParams.pData = this; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); this->m_schemaHandle = ESndPlayObj(&tagSet, ID, 0, &callParams, 0); cTagSet::~cTagSet(&tagSet); } @@ -344935,18 +344681,18 @@ eAIResult __stdcall cAIJointRotateAction::Update(cAIJointRotateAction *this) if ( this->m_pAI->GetAwareness(this->m_pAI, this->m_targetID)->level > kAIAL_Lowest ) { v1 = j__ObjPosGet(this->m_targetID); - this->m_targetAng = LODWORD(cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &v1->loc.vec)->value); + this->m_targetAng = LODWORD(cAIState::AngleTo(this->m_pAIState, &result, &v1->loc.vec)->value); } else { this->m_targetID = 0; } } - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(ID); v = jointPos[this->m_jointID] * 6.283185307178 / 360.0; floatang::floatang(&a, v); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v14); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v14); jointAng.value = operator+(&v13, FacingAng, &a)->value; v4 = Delta(&v11, &jointAng, &this->m_targetAng); floatang::floatang(&v12, v4->value); @@ -344956,7 +344702,7 @@ eAIResult __stdcall cAIJointRotateAction::Update(cAIJointRotateAction *this) cTagSet::cTagSet(&tagSet, aEventRotate_1); cTag::cTag(&v10, aLoopstate_1, aStop); cTagSet::Add(&tagSet, v5); - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); ESndPlayObj(&tagSet, v6, 0, 0, 0); this->result = kAIR_Success; v9 = this->result; @@ -345018,12 +344764,12 @@ eAIResult __stdcall cAIJointRotateAction::Enact(cAIJointRotateAction *this, int floatang::floatang(&facingAng); if ( !this->m_schemaHandle ) cAIJointRotateAction::StartRotateSchema(this); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(ID); v18 = jointPos[this->m_jointID] * 6.283185307178 / 360.0; floatang::floatang(&v28, v18); jointAng.value = v28.value; - v3 = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + v3 = cAIState::GetFacingAng(this->m_pAIState, &result); facingAng.value = operator+(&v26, v3, &jointAng)->value; if ( config_spew_on && CfgSpewTest(aJointrotate) ) CfgDoSpew("target: %g, joint: %g\n", this->m_targetAng.value, jointAng.value); @@ -345036,7 +344782,7 @@ eAIResult __stdcall cAIJointRotateAction::Enact(cAIJointRotateAction *this, int CfgDoSpew("delta %g ", deltaAng); if ( deltaAng > 0.0 ) _CriticalMsg(aDeltaang0, aRPrjThief2Skup_1862, 0xB5u); - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); g_pAITurnRateProperty->Get(g_pAITurnRateProperty, v4, &maxTurn); v5 = maxTurn / 1000.0 * 6.283185307178 / 360.0 * -1.0 * (double)deltaTime; maxTurn = v5; @@ -345054,7 +344800,7 @@ eAIResult __stdcall cAIJointRotateAction::Enact(cAIJointRotateAction *this, int _CriticalMsg(aDeltaang0_0, aRPrjThief2Skup_1863, 0xC1u); if ( config_spew_on && CfgSpewTest(aJointrotate_1) ) CfgDoSpew("delta %g ", deltaAng); - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); g_pAITurnRateProperty->Get(g_pAITurnRateProperty, v6, &maxTurn); v7 = maxTurn / 1000.0 * 6.283185307178 / 360.0 * (double)deltaTime; maxTurn = v7; @@ -345067,7 +344813,7 @@ eAIResult __stdcall cAIJointRotateAction::Enact(cAIJointRotateAction *this, int } if ( finish ) { - v8 = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v23); + v8 = cAIState::GetFacingAng(this->m_pAIState, &v23); v15 = operator-(&v22, &this->m_targetAng, v8)->value * 360.0 / 6.283185307178; jointPos[this->m_jointID] = v15; } @@ -345080,7 +344826,7 @@ eAIResult __stdcall cAIJointRotateAction::Enact(cAIJointRotateAction *this, int jointPos[this->m_jointID] = v14; } v = jointPos; - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); j__ObjSetJointPos(v11, v); this->result = kAIR_NoResultSwitch; return this->result; @@ -345135,7 +344881,7 @@ eAIResult __stdcall cAIJointSlideAction::Update(cAIJointSlideAction *this) { int ID; // eax - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( j__ObjJointPos(ID)[this->m_jointID] == this->m_target ) this->result = kAIR_Success; else @@ -345154,7 +344900,7 @@ eAIResult __stdcall cAIJointSlideAction::Enact(cAIJointSlideAction *this, unsign cAIJointSlideAction::BroadcastAction(this, deltaTime); cAIAction::SetStarted(this, 1); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); pJointPos = j__ObjJointPos(ID); if ( pJointPos[this->m_jointID] >= (double)this->m_target ) { @@ -345172,7 +344918,7 @@ eAIResult __stdcall cAIJointSlideAction::Enact(cAIJointSlideAction *this, unsign else pJointPos[this->m_jointID] = this->m_target; } - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); j__ObjSetJointPos(v3, pJointPos); this->result = kAIR_NoResultSwitch; return this->result; @@ -345226,12 +344972,12 @@ void __thiscall cAIJointScanAction::SwitchProxyDirection(cAIJointScanAction *thi LODWORD(targetAng.value) = this->m_targetAng; this->m_state = 1; } - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v3 = j__ObjJointPos(ID); v6 = targetAng.value * 360.0 / 6.283185307178; v3[this->m_jointID] = v6; v5 = v3; - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); j__ObjSetJointPos(v4, v5); this->m_bProxyWait = 0; } @@ -345272,7 +345018,7 @@ eAIResult __stdcall cAIJointScanAction::Update(cAIJointScanAction *this) targetAng.value = this->m_targetAng2.value; else targetAng.value = this->m_targetAng.value; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(ID); v = jointPos[this->m_jointID] * 6.283185307178 / 360.0; floatang::floatang(&v6, v); @@ -345355,12 +345101,12 @@ eAIResult __stdcall cAIJointScanAction::Enact(cAIJointScanAction *this, int delt callParams.flags = flags; callParams.callback = (void (__cdecl *)(int, int, void *))SchemaEndCallback_0; callParams.pData = this; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); this->m_schemaHandle = ESndPlayObj(&tagSet, ID, 0, &callParams, 0); cTagSet::~cTagSet(&tagSet); } cAIAction::SetStarted(this, 1); - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(v6); v13 = jointPos[this->m_jointID] * 6.283185307178 / 360.0; floatang::floatang(&v18, v13); @@ -345394,7 +345140,7 @@ eAIResult __stdcall cAIJointScanAction::Enact(cAIJointScanAction *this, int delt v11 = *v8 * 360.0 / 6.283185307178; jointPos[this->m_jointID] = v11; v = jointPos; - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); j__ObjSetJointPos(v9, v); this->result = kAIR_NoResultSwitch; return this->result; @@ -345574,10 +345320,10 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d flags = 0; if ( this->m_launchJoint <= 0 ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( !AIGetLaunchOffset(ID, &end) ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); launch_point = j__ObjPosGet(v5)->loc.vec; end.vec = launch_point; end.cell = -1; @@ -345587,25 +345333,25 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d else { m_launchJoint = this->m_launchJoint; - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); launch_point = *j__GetCreatureJointPos(v3, m_launchJoint); end.vec = launch_point; end.cell = -1; end.hint = -1; } - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); v7 = j__ObjPosGet(v6); *(_QWORD *)&start.vec.x = *(_QWORD *)&v7->loc.vec.x; start.vec.z = v7->loc.vec.z; - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); if ( j__ObjPosGet(v8)->loc.cell == -1 ) { - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); hint = j__ObjPosGet(v9)->loc.hint; } else { - v10 = cAIState::GetID((cAIState *)this->m_pAIState); + v10 = cAIState::GetID(this->m_pAIState); hint = j__ObjPosGet(v10)->loc.cell; } start.hint = hint; @@ -345657,11 +345403,11 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d } mx_sub_vec(&dir, &actual_target, &start_loc); if ( (this->m_flags & 1) != 0 - && (v16 = cAIState::GetID((cAIState *)this->m_pAIState), + && (v16 = cAIState::GetID(this->m_pAIState), pMyVec = (mxs_vector *)j__ObjPosGet(v16), floatang::floatang(&v39, pMyVec->x, pMyVec->y, actual_target.x, actual_target.y), floatang::floatang(&targetHeading, v17), - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result), + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &result), v19 = Delta(&v37, FacingAng, &targetHeading), floatang::floatang(&headingDelta, v19), operator>(&headingDelta, &this->m_headingEpsilon)) ) @@ -345706,7 +345452,7 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d v31 = firing_projectile; v24 = dir; v23 = start_loc; - v22 = cAIState::GetID((cAIState *)this->m_pAIState); + v22 = cAIState::GetID(this->m_pAIState); cAILaunchAction::Fire(v22, v23, v24, v31); cAILaunchAction::BroadcastAction(this, start_loc, dir); } @@ -345716,7 +345462,7 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d } else { - v13 = cAIState::GetID((cAIState *)this->m_pAIState); + v13 = cAIState::GetID(this->m_pAIState); DbgReportWarning( "cAIAttackRangedAction::Enact(): no initial velocity on projectile %d, for AI %d\n", this->m_projectile, @@ -345734,7 +345480,7 @@ eAIResult __stdcall cAILaunchAction::Enact(cAILaunchAction *this, unsigned int d } else { - v11 = cAIState::GetID((cAIState *)this->m_pAIState); + v11 = cAIState::GetID(this->m_pAIState); DbgReportWarning( "cAIAttackRangedAction::Enact(): no physics attributes on projectile %d, for AI %d\n", this->m_projectile, @@ -345807,20 +345553,20 @@ void __thiscall cAILocoAction::~cAILocoAction(cAILocoAction *this) eAIResult __thiscall cAILocoAction::UpdatePathProgress(cAILocoAction *this) { float v2; // [esp+4h] [ebp-10h] - int fReached; // [esp+10h] [ebp-4h] + BOOL fReached; // [esp+10h] [ebp-4h] if ( this->result > kAIR_NoResultSwitch ) return this->result; fReached = 0; if ( this->m_accuracyZ == 3.4028235e38 ) { - fReached = cAIState::DistSq((cAIState *)this->m_pAIState, &this->m_dest) < (double)this->m_accuracySq; + fReached = cAIState::DistSq(this->m_pAIState, &this->m_dest) < (double)this->m_accuracySq; } else { - v2 = cAIState::DiffZ((cAIState *)this->m_pAIState, &this->m_dest); + v2 = cAIState::DiffZ(this->m_pAIState, &this->m_dest); if ( ((double (__stdcall *)(IInternalAI *))this->m_pAI->GetGroundOffset)(this->m_pAI) + this->m_accuracyZ > v2 ) - fReached = cAIState::DistXYSq((cAIState *)this->m_pAIState, &this->m_dest) < (double)this->m_accuracySq; + fReached = cAIState::DistXYSq(this->m_pAIState, &this->m_dest) < (double)this->m_accuracySq; } if ( fReached ) { @@ -345955,7 +345701,7 @@ int __thiscall cAILocoAction::Pathfind(cAILocoAction *this, int bTryNearEnough, if ( this->m_pPath ) ((void (__thiscall *)(IAIPath *, IAIPath *))this->m_pPath->Release)(this->m_pPath, this->m_pPath); this->m_pPath = 0; - cAIState::GetLocation((cAIState *)this->m_pAIState); + cAIState::GetLocation(this->m_pAIState); cAILocoAction::StrokeDest(&this->m_dest, &this->m_hintCell, this->m_object); v4 = (cAIState *)((int (__thiscall *)(IInternalAI *, IInternalAI *))this->m_pAI->GetState)(this->m_pAI, this->m_pAI); StressBits = cAIState::GetStressBits(v4); @@ -345974,11 +345720,11 @@ int __thiscall cAILocoAction::Pathfind(cAILocoAction *this, int bTryNearEnough, v7 | 1)) != 0) ) { this->m_pPath = pNewPath; - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIPathWatchObj ) { m_hintCell = this->m_hintCell; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Pathfound from cell %d to cell %d\n", ID, aPath_2, PathCell, m_hintCell); } if ( !((int (__thiscall *)(IAIPath *, IAIPath *))this->m_pPath->Active)(this->m_pPath, this->m_pPath) ) @@ -345987,11 +345733,11 @@ int __thiscall cAILocoAction::Pathfind(cAILocoAction *this, int bTryNearEnough, } else { - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIPathWatchObj ) { v48 = this->m_hintCell; - v44 = cAIState::GetPathCell((cAIState *)this->m_pAIState); - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v44 = cAIState::GetPathCell(this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Failed to pathfind from cell %d to cell %d\n", v9, aPath_3, v44, v48); } if ( g_AIFlowWatchObj == -1 @@ -346009,27 +345755,27 @@ int __thiscall cAILocoAction::Pathfind(cAILocoAction *this, int bTryNearEnough, } if ( cAITimer::Expired(&timer_0) ) { - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); v54 = ((int (__thiscall *)(IAIActor *, IAIActor *))this->pOwner->GetName)(this->pOwner, this->pOwner); m_object = this->m_object; v10 = AIFindClosestCell(&this->m_dest, this->m_hintCell, m_object, 0); v49 = AIGetCellZone(kAIZone_HighStrikeLVL, v10); - v11 = cAIState::GetPathCell((cAIState *)this->m_pAIState); + v11 = cAIState::GetPathCell(this->m_pAIState); v45 = AIGetCellZone(kAIZone_HighStrikeLVL, v11); v12 = AIFindClosestCell(&this->m_dest, this->m_hintCell, this->m_object, 0); v41 = AIGetCellZone(kAIZone_HighStrike, v12); - v13 = cAIState::GetPathCell((cAIState *)this->m_pAIState); + v13 = cAIState::GetPathCell(this->m_pAIState); v39 = AIGetCellZone(kAIZone_HighStrike, v13); v14 = AIFindClosestCell(&this->m_dest, this->m_hintCell, this->m_object, 0); v37 = AIGetCellZone(kAIZone_NormalLVL, v14); - v15 = cAIState::GetPathCell((cAIState *)this->m_pAIState); + v15 = cAIState::GetPathCell(this->m_pAIState); v35 = AIGetCellZone(kAIZone_NormalLVL, v15); v16 = AIFindClosestCell(&this->m_dest, this->m_hintCell, this->m_object, 0); v33 = AIGetCellZone(kAIZone_Normal, v16); - v17 = cAIState::GetPathCell((cAIState *)this->m_pAIState); + v17 = cAIState::GetPathCell(this->m_pAIState); v31 = AIGetCellZone(kAIZone_Normal, v17); v29 = AIFindClosestCell(&this->m_dest, this->m_hintCell, this->m_object, 0); - v18 = cAIState::GetPathCell((cAIState *)this->m_pAIState); + v18 = cAIState::GetPathCell(this->m_pAIState); v52 = ((int (__cdecl *)(IAIActor *, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int, int))this->pOwner->AccessOuterAI)( this->pOwner, COERCE_UNSIGNED_INT64(Location->x), @@ -346168,11 +345914,11 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned thisa = this; if ( !this->m_pPath ) { - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); DbgReportWarning("AI %d generating loco suggestions with no path\n", ID); return -2147467259; } - loc = cAIState::GetLocation((cAIState *)thisa->m_pAIState); + loc = cAIState::GetLocation(thisa->m_pAIState); if ( g_bForcePathfind ) { g_bForcePathfind = 0; @@ -346186,8 +345932,8 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned pPrevCurEdge = v4; LOBYTE(v4) = nStressBits; f.vertexB = (unsigned int)v4; - f.vertexA = cAIState::GetPathCell((cAIState *)thisa->m_pAIState); - v5 = cAIState::GetID((cAIState *)thisa->m_pAIState); + f.vertexA = cAIState::GetPathCell(thisa->m_pAIState); + v5 = cAIState::GetID(thisa->m_pAIState); v6 = j__ObjPosGet(v5); look = ((int (__thiscall *)(IAIPath *, IAIPath *, const cMxsVector *, mxs_angvec *, unsigned int, unsigned int))thisa->m_pPath->UpdateTargetEdge)( thisa->m_pPath, @@ -346201,9 +345947,7 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned thisa->m_pPath); if ( pCurEdge ) { - if ( pPrevCurEdge - && look - && (g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj) ) + if ( pPrevCurEdge && look && (g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj) ) { if ( look <= 0 ) v31 = -look; @@ -346215,8 +345959,8 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned v30 = aAhead; f = *pCurEdge; v22 = *pPrevCurEdge; - PathCell = cAIState::GetPathCell((cAIState *)thisa->m_pAIState); - v7 = cAIState::GetID((cAIState *)thisa->m_pAIState); + PathCell = cAIState::GetPathCell(thisa->m_pAIState); + v7 = cAIState::GetID(thisa->m_pAIState); mprintf( "[AI(%3d) Watch:%5s] Looked %s %d edges from [cell %d, edge [%d (%d,%d)]] to edge [%d (%d,%d)]\n", v7, @@ -346254,10 +345998,10 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned { ((void (__thiscall *)(IAIPath *, IAIPath *))thisa->m_pPath->Clear)(thisa->m_pPath, thisa->m_pPath); thisa->flags |= 8u; - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj ) { f.vertexB = (unsigned int)aPath_5; - v9 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v9 = cAIState::GetID(thisa->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Reached end of path\n", v9, aPath_5); } } @@ -346266,11 +346010,11 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned pCurEdge = (const cAIPathEdge *)((int (__thiscall *)(IAIPath *, IAIPath *))thisa->m_pPath->GetCurEdge)( thisa->m_pPath, thisa->m_pPath); - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj ) { f = *pCurEdge; v23 = *pPrevCurEdge; - v10 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v10 = cAIState::GetID(thisa->m_pAIState); mprintf( "[AI(%3d) Watch:%5s] Reached waypoint: advancing on path from edge [%d (%d,%d)] to edge [%d (%d,%d)]\n", v10, @@ -346289,10 +346033,10 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned { ((void (__thiscall *)(IAIPath *, IAIPath *))thisa->m_pPath->Clear)(thisa->m_pPath, thisa->m_pPath); thisa->flags |= 8u; - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj ) { f.vertexB = (unsigned int)aPath_7; - v11 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v11 = cAIState::GetID(thisa->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Path is empty\n", v11, aPath_7); } } @@ -346300,19 +346044,19 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned cMxsVector::cMxsVector(&suggestLoc); if ( (thisa->flags & 8) != 0 || !thisa->m_pPath->MoreEdges(thisa->m_pPath) - && (LOBYTE(v12) = cAIState::GetStressBits((cAIState *)thisa->m_pAIState), + && (LOBYTE(v12) = cAIState::GetStressBits(thisa->m_pAIState), f.vertexB = v12, - v13 = cAIState::GetPathCell((cAIState *)thisa->m_pAIState), + v13 = cAIState::GetPathCell(thisa->m_pAIState), thisa->m_pPath->IsDestVisible(thisa->m_pPath, loc, v13, f.vertexB)) ) { suggestLoc = thisa->m_dest; - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj ) { *(double *)&f.vertexA = AIDistance(&thisa->m_dest, loc); f.cell = (__int64)thisa->m_dest.z; y = (__int64)thisa->m_dest.y; x = (__int64)thisa->m_dest.x; - v14 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v14 = cAIState::GetID(thisa->m_pAIState); mprintf( "[AI(%3d) Watch:%5s] Suggesting move to target location (%d, %d, %d) [%g feet]\n", v14, @@ -346327,13 +346071,13 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned { pCurEdge = thisa->m_pPath->GetCurEdge(thisa->m_pPath); cAIPathEdge::GetCenter((cAIPathEdge *)pCurEdge, &suggestLoc); - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIPathWatchObj ) { *(double *)&f.vertexA = AIDistance(&suggestLoc, loc); f.cell = (__int64)suggestLoc.z; v27 = (__int64)suggestLoc.y; v25 = (__int64)suggestLoc.x; - v15 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v15 = cAIState::GetID(thisa->m_pAIState); mprintf( "[AI(%3d) Watch:%5s] Suggesting move to (%d, %d, %d) [%g feet]\n", v15, @@ -346378,7 +346122,7 @@ int __thiscall cAILocoAction::GenerateSuggestions(cAILocoAction *this, unsigned floatang::floatang(&v34, 5.6548667); f.vertexB = v17; floatang::floatang((floatang *)&f.vertexB, v18); - v19 = cAIState::AngleTo((cAIState *)thisa->m_pAIState, &v33, &suggestLoc); + v19 = cAIState::AngleTo(thisa->m_pAIState, &v33, &suggestLoc); f.vertexA = v20; floatang::floatang((floatang *)&f.vertexA, v19); floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, (floatang)f.vertexA, (floatang)f.vertexB); @@ -346417,7 +346161,7 @@ double __thiscall cAILocoAction::ComputePathDist(cAILocoAction *this) if ( !cAILocoAction::Pathfind(this, result > 0.0, this->fPathNearDist) ) return 0.0; } - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); this->m_pPath->ComputeXYLength(this->m_pPath, Location); return result; } @@ -346428,7 +346172,7 @@ eAIResult __stdcall cAILocoAction::Update(cAILocoAction *this) int ID; // eax const char *v3; // [esp+0h] [ebp-Ch] eAIResult tempResult; // [esp+4h] [ebp-8h] - int pathResult; // [esp+8h] [ebp-4h] + eAIResult pathResult; // [esp+8h] [ebp-4h] if ( this->InProgress(this) ) { @@ -346438,7 +346182,7 @@ eAIResult __stdcall cAILocoAction::Update(cAILocoAction *this) if ( this->result == kAIR_NoResultSwitch ) { pathResult = cAILocoAction::UpdatePathProgress(this); - if ( pathResult > 1 ) + if ( pathResult > kAIR_NoResultSwitch ) this->result = pathResult; } } @@ -346452,13 +346196,13 @@ eAIResult __stdcall cAILocoAction::Update(cAILocoAction *this) cAILocoAction::ClearPathAndMove(this); this->result = tempResult; this->pctComplete = 100; - if ( g_AIPathWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIPathWatchObj ) + if ( g_AIPathWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIPathWatchObj ) { if ( this->result == kAIR_Success ) v3 = aComplete; else v3 = aFailed_2; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Path traversal %s\n", ID, aPath_10, v3); } } @@ -346551,7 +346295,7 @@ eAIResult __stdcall cAIMotionAction::Update(cAIMotionAction *this) if ( !this->m_pEnactor ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("No movement enactor for motion action from AI %d\n", ID); this->result = kAIR_Fail; return this->result; @@ -346627,7 +346371,7 @@ eAIResult __stdcall cAIMotionAction::Enact(cAIMotionAction *this, unsigned int d } else { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("No movement enactor for motion action from AI %d\n", ID); this->result = kAIR_Fail; return this->result; @@ -346683,7 +346427,7 @@ int __thiscall cAIMoveAction::Resolve(cAIMoveAction *this, const sAIMoveSuggesti } else { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("No movement enactor for move action from AI %d\n", ID); return 0; } @@ -346694,12 +346438,12 @@ eAIResult __stdcall cAIMoveAction::Update(cAIMoveAction *this) { int ID; // eax const char *v3; // eax - int v4; // [esp+0h] [ebp-10h] + eAIMEStatus v4; // [esp+0h] [ebp-10h] cAnsiStr descStr; // [esp+4h] [ebp-Ch] BYREF if ( !this->m_pEnactor ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("No movement enactor for move action from AI %d\n", ID); this->result = kAIR_Fail; return this->result; @@ -346708,11 +346452,11 @@ eAIResult __stdcall cAIMoveAction::Update(cAIMoveAction *this) { cAnsiStr::cAnsiStr(&descStr); v4 = this->m_pEnactor->GetStatus(this->m_pEnactor); - if ( v4 >= 0 ) + if ( v4 >= kAIME_Idle ) { - if ( v4 <= 1 ) + if ( v4 <= kAIME_ActiveInterrupt ) goto LABEL_8; - if ( v4 != 2 ) + if ( v4 != kAIME_ActiveBusy ) goto LABEL_12; if ( cAITimer::Expired(&this->m_MinInterrupt) ) { @@ -346745,7 +346489,7 @@ eAIResult __stdcall cAIMoveAction::Enact(cAIMoveAction *this, unsigned int delta if ( !this->m_pEnactor ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); DbgReportWarning("No movement enactor for move action from AI %d\n", ID); this->result = kAIR_Fail; return this->result; @@ -346843,7 +346587,7 @@ int __stdcall cAIMoveToMarkerAction::Enact(cAIMoveToMarkerAction *this, unsigned _CriticalMsg(aMPcurrelation, aRPrjThief2Skup_1851, 0xDAu); if ( !this->cAIAction::Started(this) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); query = this->m_pCurRelation->Query(this->m_pCurRelation, ID, 0); if ( !query->Done(query) ) { @@ -347077,7 +346821,7 @@ eAIResult __stdcall cAIPsdScrAction::Enact(cAIPsdScrAction *this, unsigned int d } //----- (005802C3) -------------------------------------------------------- -cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this) +cAIOrientAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this) { int ID; // eax const char *v2; // eax @@ -347103,7 +346847,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this const char *v23; // eax IContainSys *v24; // eax const char *v25; // eax - int v26; // eax + unsigned int v26; // eax const char *v27; // eax const char *v28; // eax const char *v29; // eax @@ -347202,7 +346946,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this int metaProp; // [esp+114h] [ebp-A4h] cAIWaitAction *pWaitAction; // [esp+118h] [ebp-A0h] cAutoIPtr pContainSys; // [esp+11Ch] [ebp-9Ch] BYREF - float v125; // [esp+120h] [ebp-98h] + int v125; // [esp+120h] [ebp-98h] sFrobActivate frob_info; // [esp+124h] [ebp-94h] BYREF int withObj; // [esp+140h] [ebp-78h] cAILocoAction *pLocoAction; // [esp+144h] [ebp-74h] @@ -347227,7 +346971,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this act = cDABase>::operator[](&this->m_actions, this->m_iCurrent); cAnsiStr::cAnsiStr(&tempStr); cObjListParser::cObjListParser(&objListParser); - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)thisa->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(thisa->m_pAIState) == g_AIFlowWatchObj ) { if ( sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 2u) ) Arg = sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 2u); @@ -347244,7 +346988,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this LODWORD(v70.value) = (floatang)Arg; LODWORD(v69.value) = (floatang)v79; v67 = g_ppszAIPsdScrActions[act->type]; - ID = cAIState::GetID((cAIState *)thisa->m_pAIState); + ID = cAIState::GetID(thisa->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Pseudo-script: %s (\"%s\", \"%s\", \"%s\")\n", ID, aFlow_15, v67, v78, v79, Arg); } type = act->type; @@ -347279,13 +347023,13 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this if ( !cIPtrBase::operator!(&pScriptMan) ) { if ( act->type == kAIPS_Script ) - m_dest = cAIState::GetID((cAIState *)thisa->m_pAIState); + m_dest = cAIState::GetID(thisa->m_pAIState); else m_dest = thisa->m_dest; LODWORD(v70.value) = (floatang)&arg3; LODWORD(v69.value) = (floatang)&arg2; v68 = sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 0); - v66 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v66 = cAIState::GetID(thisa->m_pAIState); v12 = cIPtr::operator->(&pScriptMan); v12->SendMessage2(v12, &reply, v66, m_dest, v68, &arg1, &arg2, &arg3); if ( cMultiParm::GetType(&reply) ) @@ -347329,18 +347073,18 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this v99 = pMotionAction; cObjListParser::~cObjListParser(&objListParser); cAnsiStr::~cAnsiStr(&tempStr); - return v99; + return (cAIOrientAction *)v99; case kAIPS_Alert: DbgReportWarning("Ai pseudo-script action \"%s\" is unimplemented\n", g_ppszAIPsdScrActions[act->type]); goto LABEL_159; case kAIPS_BecomeHostile: LODWORD(v70.value) = 0; - v6 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v6 = cAIState::GetID(thisa->m_pAIState); g_pAINonHostilityProperty->Set(g_pAINonHostilityProperty, v6, 0); goto LABEL_159; case kAIPS_EnableInvestigate: LODWORD(v70.value) = 0; - v7 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v7 = cAIState::GetID(thisa->m_pAIState); g_pAIInvestKindProperty->Set(g_pAIInvestKindProperty, v7, 0); goto LABEL_159; case kAIPS_Goto: @@ -347355,7 +347099,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this { v14 = cDABase>::operator[](&targets, i); ObjLocation = GetObjLocation(*v14); - curDist = cAIState::DistSq((cAIState *)thisa->m_pAIState, ObjLocation); + curDist = cAIState::DistSq(thisa->m_pAIState, ObjLocation); if ( curDist < (double)targDist ) { targObj = *cDABase>::operator[](&targets, i); @@ -347395,7 +347139,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this v97 = pLocoAction; cObjListParser::~cObjListParser(&objListParser); cAnsiStr::~cAnsiStr(&tempStr); - return (cAIMotionAction *)v97; + return (cAIOrientAction *)v97; case kAIPS_Frob: if ( sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 0) ) { @@ -347404,7 +347148,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this cAnsiStr::operator=(&tempStr, v20); cAnsiStr::Trim(&tempStr); v21 = cAnsiStr::operator char const *(&tempStr); - v125 = COERCE_FLOAT(ObjFromString(v21)); + v125 = ObjFromString(v21); if ( sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 1u) ) { v22 = sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 1u); @@ -347417,24 +347161,24 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this { withObj = 0; } - frob_info.frobber = cAIState::GetID((cAIState *)thisa->m_pAIState); + frob_info.frobber = cAIState::GetID(thisa->m_pAIState); frob_info.ms_down = 1; if ( withObj ) { frob_info.src_loc = kFrobLocTool; frob_info.src_obj = withObj; frob_info.dst_loc = kFrobLocWorld; - *(float *)&frob_info.dst_obj = v125; + frob_info.dst_obj = v125; } else { v24 = (IContainSys *)_AppGetAggregated(&IID_IContainSys); cAutoIPtr::cAutoIPtr(&pContainSys, v24); - v70.value = v125; - LODWORD(v69.value) = (floatang)cAIState::GetID((cAIState *)thisa->m_pAIState); + LODWORD(v70.value) = (floatang)v125; + LODWORD(v69.value) = (floatang)cAIState::GetID(thisa->m_pAIState); v74 = cIPtr::operator->(&pContainSys); frob_info.src_loc = v74->Contains(v74, (int)v69.value, (int)v70.value) != 0; - *(float *)&frob_info.src_obj = v125; + frob_info.src_obj = v125; frob_info.dst_loc = kFrobLocNone; frob_info.dst_obj = 0; cAutoIPtr::~cAutoIPtr(&pContainSys); @@ -347456,7 +347200,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this v95 = pWaitAction; cObjListParser::~cObjListParser(&objListParser); cAnsiStr::~cAnsiStr(&tempStr); - return (cAIMotionAction *)v95; + return (cAIOrientAction *)v95; case kAIPS_Mprint: if ( sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 0) ) { @@ -347482,7 +347226,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this } else { - item = cAIState::GetID((cAIState *)thisa->m_pAIState); + item = cAIState::GetID(thisa->m_pAIState); cDABase>::Append(&pResult, &item); } if ( cDABase>::Size(&pResult) ) @@ -347543,7 +347287,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this } else { - v92 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v92 = cAIState::GetID(thisa->m_pAIState); cDABase>::Append(&destinations, &v92); } if ( !cDABase>::Size(&destinations) ) @@ -347578,7 +347322,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this } else { - v90 = cAIState::GetID((cAIState *)thisa->m_pAIState); + v90 = cAIState::GetID(thisa->m_pAIState); cDABase>::Append(&sources, &v90); } v41 = sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 0); @@ -347645,7 +347389,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this { v45 = cDABase>::operator[](&v112, index); v46 = GetObjLocation(*v45); - v110 = cAIState::DistSq((cAIState *)thisa->m_pAIState, v46); + v110 = cAIState::DistSq(thisa->m_pAIState, v46); } if ( v110 < (double)v113 ) { @@ -347669,7 +347413,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this if ( relativeTo == -1 ) { floatang::floatang(&___ReturnUdt, angle); - FacingAng = cAIState::GetFacingAng((cAIState *)thisa->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(thisa->m_pAIState, &result); v50 = operator+(&v86, &___ReturnUdt, FacingAng); floatang::floatang(&v89, v50); v70.value = v51; @@ -347696,7 +347440,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this { if ( relativeTo == -1 ) { - v55 = cAIState::GetFacingAng((cAIState *)thisa->m_pAIState, &v83); + v55 = cAIState::GetFacingAng(thisa->m_pAIState, &v83); floatang::floatang(&v84, v55); v70.value = v56; floatang::floatang(&v70, v57); @@ -347710,7 +347454,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this v82 = pOrientAction; cObjListParser::~cObjListParser(&objListParser); cAnsiStr::~cAnsiStr(&tempStr); - return (cAIMotionAction *)v82; + return v82; case kAIPS_Signal: if ( sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 0) && sAIPsdScrAct::GetArg((sAIPsdScrAct *)act, 1u) ) { @@ -347743,7 +347487,7 @@ cAIMotionAction *__thiscall cAIPsdScrAction::HandleCurrent(cAIPsdScrAction *this v63 = cDABase>::operator[](&v102, j); if ( GetObjLocation(*v63, &targetPos) ) { - v64 = cAIState::DistSq((cAIState *)thisa->m_pAIState, &targetPos); + v64 = cAIState::DistSq(thisa->m_pAIState, &targetPos); if ( v64 > limitSq ) continue; } @@ -348222,7 +347966,7 @@ eAIResult __stdcall cAIOrientAction::Update(cAIOrientAction *this) const floatang *FacingAng; // eax float v2; // ecx floatang v4; // [esp-4h] [ebp-20h] BYREF - float f; // [esp+0h] [ebp-1Ch] BYREF + floatang f; // [esp+0h] [ebp-1Ch] BYREF floatang result; // [esp+Ch] [ebp-10h] BYREF floatang curAngle; // [esp+10h] [ebp-Ch] BYREF floatarc arc; // [esp+14h] [ebp-8h] BYREF @@ -348230,22 +347974,23 @@ eAIResult __stdcall cAIOrientAction::Update(cAIOrientAction *this) if ( this->m_pMoveAction ) { floatarc::floatarc(&arc); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &result); floatang::floatang(&curAngle, FacingAng); - f = v2; - floatang::floatang((floatang *)&f, 0.17453292); + f.value = v2; + floatang::floatang(&f, 0.17453292); LODWORD(v4.value) = (floatang)&this->m_angle; floatang::floatang(&v4, &this->m_angle); - floatarc::SetByCenterAndSpan(&arc, v4, LODWORD(f)); + floatarc::SetByCenterAndSpan(&arc, v4, f); if ( floatarc::contains(&arc, &curAngle) - || (f = this->m_lastAngle.value - curAngle.value, ffabsf(f) < 0.02) && cAITimer::Expired(&this->m_Timeout) ) + || (f.value = this->m_lastAngle.value - curAngle.value, ffabsf(f.value) < 0.02) + && cAITimer::Expired(&this->m_Timeout) ) { this->result = kAIR_Success; } else { - f = this->m_lastAngle.value - curAngle.value; - if ( ffabsf(f) >= 0.02 ) + f.value = this->m_lastAngle.value - curAngle.value; + if ( ffabsf(f.value) >= 0.02 ) { cAITimer::Reset(&this->m_Timeout); this->m_lastAngle.value = curAngle.value; @@ -348289,12 +348034,12 @@ eAIResult __stdcall cAIOrientAction::Enact(cAIOrientAction *this, unsigned int d { cAIAction::SetStarted(this, 1); this->m_pMoveAction = cAIAction::CreateMoveAction(this, 0); - this->m_lastAngle = LODWORD(cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value); + this->m_lastAngle = LODWORD(cAIState::GetFacingAng(this->m_pAIState, &result)->value); m_type = this->m_type; if ( m_type == kAIOT_Toward ) { GetObjLocation(this->m_object, &objLoc); - this->m_angle = LODWORD(cAIState::AngleTo((cAIState *)this->m_pAIState, &v13, &objLoc)->value); + this->m_angle = LODWORD(cAIState::AngleTo(this->m_pAIState, &v13, &objLoc)->value); } else if ( m_type == kAIOT_Relative ) { @@ -348370,7 +348115,7 @@ void __thiscall cAIAttackRangedAction::SetupMotions(cAIAttackRangedAction *this) int ID; // eax cTagSet source; // [esp+4h] [ebp-8h] BYREF - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( j__CreatureExists(ID) ) { this->m_pMotionAction = cAIAction::CreateMotionAction(this, this->ownerData); @@ -348527,7 +348272,7 @@ eAIResult __stdcall cAIAttackRangedAction::Update(cAIAttackRangedAction *this) } if ( this->m_pMotionAction ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( j__PollMotionFlags(ID, 0x20u) ) { this->m_LaunchReady = 1; @@ -348592,11 +348337,11 @@ eAIResult __stdcall cAIAttackRangedAction::Enact(cAIAttackRangedAction *this, un { this->m_LaunchReady = 0; this->m_Launched = 1; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); j__WeaponEvent(512, ID, 0, 2); if ( this->m_pLaunchAction->Enact(this->m_pLaunchAction, deltaTime) == kAIR_Fail ) this->m_LaunchFailed = 1; - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(1024, v3, 0, 2); this->result = kAIR_NoResultSwitch; return 0; @@ -348614,13 +348359,13 @@ eAIResult __stdcall cAIAttackRangedAction::Enact(cAIAttackRangedAction *this, un if ( this->m_targetObj ) { v5 = j__ObjPosGet(this->m_targetObj); - v6 = cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &v5->loc.vec); + v6 = cAIState::AngleTo(this->m_pAIState, &result, &v5->loc.vec); cAIMotionAction::SetFacing(this->m_pMotionAction, v6); cAIMotionAction::SetFocus(this->m_pMotionAction, this->m_targetObj, this->m_rotationSpeed); } this->m_pMotionAction->Enact(this->m_pMotionAction, deltaTime); this->m_MotionStarted = 1; - v7 = cAIState::GetID((cAIState *)this->m_pAIState); + v7 = cAIState::GetID(this->m_pAIState); j__WeaponEvent(256, v7, 0, 2); } return 0; @@ -348678,20 +348423,20 @@ eAIResult __stdcall cAISeqAction::Update(cAISeqAction *this) ++this->m_iCurrent; if ( this->m_iCurrent >= cDABase>::Size(&this->m_sequence) ) { - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Sequenced action done\n", ID, aFlow_12); } } else { - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { - v1 = cAIState::GetID((cAIState *)this->m_pAIState); + v1 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Sequenced action step complete\n", v1, aFlow_10); } - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { cAnsiStr::cAnsiStr(&desc); if ( *cDABase>::operator[](&this->m_sequence, this->m_iCurrent) ) @@ -348707,10 +348452,10 @@ eAIResult __stdcall cAISeqAction::Update(cAISeqAction *this) cAnsiStr::operator=(&desc, aNoAction_0); pszAbilityName = aNone_8; } - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { v6 = cAnsiStr::operator char const *(&desc); - v2 = cAIState::GetID((cAIState *)this->m_pAIState); + v2 = cAIState::GetID(this->m_pAIState); mprintf( "[AI(%3d) Watch:%5s] Sequenced action: \"%s\" from ability \"%s\"\n", v2, @@ -348724,9 +348469,9 @@ eAIResult __stdcall cAISeqAction::Update(cAISeqAction *this) } } else if ( this->result > kAIR_Success - && (g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj) ) + && (g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj) ) { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Sequenced action step failed\n", v4, aFlow_13); } } @@ -348753,7 +348498,7 @@ eAIResult __stdcall cAISeqAction::Enact(cAISeqAction *this, unsigned int deltaTi if ( !this->cAIAction::Started(this) ) { cAIAction::SetStarted(this, 1); - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { cAnsiStr::cAnsiStr(&desc); if ( *cDABase>::operator[](&this->m_sequence, this->m_iCurrent) ) @@ -348769,10 +348514,10 @@ eAIResult __stdcall cAISeqAction::Enact(cAISeqAction *this, unsigned int deltaTi cAnsiStr::operator=(&desc, aNoAction_1); pszAbilityName = aNone_9; } - if ( g_AIFlowWatchObj == -1 || cAIState::GetID((cAIState *)this->m_pAIState) == g_AIFlowWatchObj ) + if ( g_AIFlowWatchObj == -1 || cAIState::GetID(this->m_pAIState) == g_AIFlowWatchObj ) { v5 = cAnsiStr::operator char const *(&desc); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); mprintf("[AI(%3d) Watch:%5s] Sequenced action: \"%s\" from ability \"%s\"\n", ID, aFlow_14, v5, pszAbilityName); } cAnsiStr::~cAnsiStr(&desc); @@ -348873,7 +348618,7 @@ cAILocoAction *__thiscall cAIWanderAction::PickLoco(cAIWanderAction *this) unsigned int destCell; // [esp+94h] [ebp-4h] BYREF thisa = this; - aiLoc = cAIState::GetLocation((cAIState *)this->m_pAIState); + aiLoc = cAIState::GetLocation(this->m_pAIState); pPathfinder = (IAIPathfinder *)((int (__thiscall *)(IInternalAI *, IInternalAI *))thisa->m_pAI->AccessPathfinder)( thisa->m_pAI, thisa->m_pAI); @@ -349049,7 +348794,7 @@ eAIResult __stdcall cAIWanderAction::Enact(cAIWanderAction *this, unsigned int d this->m_pMotionAction = 0; if ( cMxsVector::operator==(&kInvalidLoc, &this->m_Center) ) { - this->m_Center = cAIState::GetLocation((cAIState *)this->m_pAIState)->mxs_vector; + this->m_Center = cAIState::GetLocation(this->m_pAIState)->mxs_vector; this->m_fLastWasCenter = 1; } else @@ -349321,7 +349066,7 @@ void __thiscall cAIJointRotateAction::BroadcastAction(cAIJointRotateAction *this IAINetManager *v11; // [esp+8h] [ebp-4Ch] IObjectNetworking *v12; // [esp+Ch] [ebp-48h] INetManager *v13; // [esp+10h] [ebp-44h] - char v15[4]; // [esp+18h] [ebp-3Ch] BYREF + _BYTE v15[4]; // [esp+18h] [ebp-3Ch] BYREF cAutoIPtr v16; // [esp+1Ch] [ebp-38h] BYREF cAutoIPtr pAINetMan; // [esp+20h] [ebp-34h] BYREF sAINetMsg_Header hdr; // [esp+24h] [ebp-30h] @@ -349338,13 +349083,13 @@ void __thiscall cAIJointRotateAction::BroadcastAction(cAIJointRotateAction *this v13 = cIPtr::operator->(&pNetMan); if ( v13->Networking(v13) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v12 = cIPtr::operator->(&pObjNet); if ( v12->ObjHostedHere(v12, ID) ) { if ( config_spew_on && CfgSpewTest(aNetAiSpew_2) ) { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Send joint rotate for %d\n", v4); } v5 = (IAINetManager *)_AppGetAggregated(&IID_IAINetManager); @@ -349353,7 +349098,7 @@ void __thiscall cAIJointRotateAction::BroadcastAction(cAIJointRotateAction *this cAutoIPtr::cAutoIPtr(&v16, v6); v11 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v11->NetMsgHandlerID(v11); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 65537; sAINetMsg_JointRotate_NG::sAINetMsg_JointRotate_NG(&netmsg); @@ -349364,7 +349109,7 @@ void __thiscall cAIJointRotateAction::BroadcastAction(cAIJointRotateAction *this netmsg.targetAng.value = this->m_targetAng.value; m_targetID = this->m_targetID; v10 = cIPtr::operator->(&v16); - netmsg.targetGID = *(sGlobalObjID *)((int (__stdcall *)(INetManager *, char *, int))v10->ToGlobalObjID)( + netmsg.targetGID = *(sGlobalObjID *)((int (__stdcall *)(INetManager *, _BYTE *, int))v10->ToGlobalObjID)( v10, v15, m_targetID); @@ -349379,7 +349124,6 @@ void __thiscall cAIJointRotateAction::BroadcastAction(cAIJointRotateAction *this cAutoIPtr::~cAutoIPtr(&pObjNet); cAutoIPtr::~cAutoIPtr(&pNetMan); } -// 584B51: using guessed type char var_3C[4]; //----- (00584D2B) -------------------------------------------------------- void __thiscall cAIJointSlideAction::cAIJointSlideAction( @@ -349443,13 +349187,13 @@ void __thiscall cAIJointSlideAction::BroadcastAction(cAIJointSlideAction *this, v11 = cIPtr::operator->(&pNetMan); if ( v11->Networking(v11) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v10 = cIPtr::operator->(&pObjNet); if ( v10->ObjHostedHere(v10, ID) ) { if ( config_spew_on && CfgSpewTest(aNetAiSpew_4) ) { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Send joint slide for %d\n", v4); } v5 = (IAINetManager *)_AppGetAggregated(&IID_IAINetManager); @@ -349458,7 +349202,7 @@ void __thiscall cAIJointSlideAction::BroadcastAction(cAIJointSlideAction *this, cAutoIPtr::cAutoIPtr(&v13, v6); v9 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v9->NetMsgHandlerID(v9); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 65538; *(_DWORD *)&netmsg.aihdr.handlerID = *(_DWORD *)&hdr.handlerID; @@ -349503,13 +349247,13 @@ void __thiscall cAIJointScanAction::BroadcastHalt(cAIJointScanAction *this) v8 = cIPtr::operator->(&pNetMan); if ( v8->Networking(v8) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v7 = cIPtr::operator->(&pObjNet); if ( v7->ObjHostedHere(v7, ID) ) { v6 = cIPtr::operator->(&pAINetMan); netmsg.handlerID = v6->NetMsgHandlerID(v6); - netmsg.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + netmsg.aiObj = cAIState::GetID(this->m_pAIState); netmsg.stopping = 1; netmsg.action = 65539; v5 = cIPtr::operator->(&pNetMan); @@ -349536,7 +349280,7 @@ void __thiscall cAIJointScanAction::BroadcastAction(cAIJointScanAction *this, un if ( config_spew_on && CfgSpewTest(aNetAiSpew_5) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Send joint scan for %d\n", ID); } Aggregated = (IAINetManager *)_AppGetAggregated(&IID_IAINetManager); @@ -349545,7 +349289,7 @@ void __thiscall cAIJointScanAction::BroadcastAction(cAIJointScanAction *this, un cAutoIPtr::cAutoIPtr(&pNetMan, v4); v6 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v6->NetMsgHandlerID(v6); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 65539; sAINetMsg_JointScan_NG::sAINetMsg_JointScan_NG(&netmsg); @@ -349657,7 +349401,7 @@ void __thiscall cAIJointScanAction::BroadcastSwitchDirections(cAIJointScanAction if ( config_spew_on && CfgSpewTest(aNetScanSpew_0) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Sending joint scan synch for %d\n", ID); } Aggregated = (INetManager *)_AppGetAggregated(&IID_INetManager); @@ -349666,7 +349410,7 @@ void __thiscall cAIJointScanAction::BroadcastSwitchDirections(cAIJointScanAction cAutoIPtr::cAutoIPtr(&pAINetMan, v3); v5 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v5->NetMsgHandlerID(v5); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 65539; sAINetMsg_JointScan_NG::sAINetMsg_JointScan_NG(&netmsg); @@ -349698,15 +349442,15 @@ int __thiscall cAIJointScanAction::NetUpdate(cAIJointScanAction *this) v8 = cIPtr::operator->(&pNetMan); if ( v8->Networking(v8) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v7 = cIPtr::operator->(&pObjNet); - if ( v7->ObjHostedHere(v7, ID) && cAIState::GetMode((cAIState *)this->m_pAIState) >= kAIM_Normal ) + if ( v7->ObjHostedHere(v7, ID) && cAIState::GetMode(this->m_pAIState) >= kAIM_Normal ) { cAIJointScanAction::BroadcastSwitchDirections(this); } else { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); v6 = cIPtr::operator->(&pObjNet); if ( v6->ObjIsProxy(v6, v5) ) { @@ -349742,7 +349486,7 @@ int __thiscall cAIJointScanAction::IsHostedHere(cAIJointScanAction *this) v7 = cIPtr::operator->(&pNetMan); if ( v7->Networking(v7) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v6 = cIPtr::operator->(&pObjNet); v5 = v6->ObjHostedHere(v6, ID); } @@ -349823,7 +349567,7 @@ void __thiscall cAILaunchAction::BroadcastAction(cAILaunchAction *this, mxs_vect cAutoIPtr::cAutoIPtr(&pAINetMan, v4); v12 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v12->NetMsgHandlerID(v12); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 17; *(_DWORD *)&netmsg.aihdr.handlerID = *(_DWORD *)&hdr.handlerID; @@ -349837,7 +349581,7 @@ void __thiscall cAILaunchAction::BroadcastAction(cAILaunchAction *this, mxs_vect projectileArch = v11->GetArchetype(v11, m_projectile); if ( config_spew_on && CfgSpewTest(aNetAiSpew_7) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Launch %d for %d\n", projectileArch, ID); } v7 = (IObjectNetworking *)_AppGetAggregated(&IID_IObjectNetworking); @@ -349963,7 +349707,7 @@ void __thiscall cAIGunAction::cAIGunAction(cAIGunAction *this, IInternalAI *pAI) this->m_pAI = pAI; this->m_pAIState = this->m_pAI->GetState(this->m_pAI); cAIGunAction::Initialize(this); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); this->m_gunJointID = AIGetProperty(g_pAIDeviceProperty, ID, &g_AIDefaultDeviceParams)->m_jointRotate; } // 97CDA4: using guessed type void *cAIGunAction::`vftable'; @@ -349982,13 +349726,13 @@ void __thiscall cAIGunAction::Initialize(cAIGunAction *this) Aggregated = (ITraitManager *)_AppGetAggregated(&IID_ITraitManager); cAutoIPtr::cAutoIPtr(&pTraitMan, Aggregated); - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v5 = cIPtr::operator->(&pTraitMan); v2 = ((int (__stdcall *)(ITraitManager *, int, _DWORD))v5->GetArchetype)(v5, ID, 0); query = (ILinkQuery *)((int (__stdcall *)(IRelation *, int))g_pAIRangedWeaponLinks->Query)(g_pAIRangedWeaponLinks, v2); if ( query->Done(query) ) { - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); DbgReportWarning("cAIGunAction: no Ranged Weapon link for AI %d\n", v3); } else @@ -350032,7 +349776,7 @@ eAIResult __stdcall cAIGunAction::Update(cAIGunAction *this) { if ( CfgSpewTest(aAigunspew) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d: Returning success\n", ID); } } @@ -350067,7 +349811,7 @@ void __thiscall cAIGunAction::BroadcastShoot(cAIGunAction *this) INetManager *v5; // [esp+0h] [ebp-38h] INetManager *v6; // [esp+4h] [ebp-34h] IAINetManager *v7; // [esp+8h] [ebp-30h] - char v9[4]; // [esp+10h] [ebp-28h] BYREF + _BYTE v9[4]; // [esp+10h] [ebp-28h] BYREF cAutoIPtr pNetMan; // [esp+14h] [ebp-24h] BYREF cAutoIPtr pAINetMan; // [esp+18h] [ebp-20h] BYREF sAINetMsg_Header hdr; // [esp+1Ch] [ebp-1Ch] @@ -350075,7 +349819,7 @@ void __thiscall cAIGunAction::BroadcastShoot(cAIGunAction *this) if ( config_spew_on && CfgSpewTest(aNetAiSpew) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("NET AI: Send turret shoot for %d\n", ID); } Aggregated = (IAINetManager *)_AppGetAggregated(&IID_IAINetManager); @@ -350084,14 +349828,14 @@ void __thiscall cAIGunAction::BroadcastShoot(cAIGunAction *this) cAutoIPtr::cAutoIPtr(&pNetMan, v3); v7 = cIPtr::operator->(&pAINetMan); hdr.handlerID = v7->NetMsgHandlerID(v7); - hdr.aiObj = cAIState::GetID((cAIState *)this->m_pAIState); + hdr.aiObj = cAIState::GetID(this->m_pAIState); hdr.stopping = 0; hdr.action = 65540; *(_DWORD *)&netmsg.aihdr.handlerID = *(_DWORD *)&hdr.handlerID; netmsg.aihdr.action = 65540; m_targetObj = this->m_targetObj; v6 = cIPtr::operator->(&pNetMan); - netmsg.target = *(sGlobalObjID *)((int (__stdcall *)(INetManager *, char *, int))v6->ToGlobalObjID)( + netmsg.target = *(sGlobalObjID *)((int (__stdcall *)(INetManager *, _BYTE *, int))v6->ToGlobalObjID)( v6, v9, m_targetObj); @@ -350102,7 +349846,6 @@ void __thiscall cAIGunAction::BroadcastShoot(cAIGunAction *this) cAutoIPtr::~cAutoIPtr(&pNetMan); cAutoIPtr::~cAutoIPtr(&pAINetMan); } -// 58634B: using guessed type char var_28[4]; //----- (0058646E) -------------------------------------------------------- void __cdecl cAIGunAction::EnactProxyShootGun(IAI *pAI, sAINetMsg_ShockShoot *pMsg) @@ -350181,14 +349924,14 @@ void __thiscall cAIGunAction::Shoot(cAIGunAction *this) cAutoIPtr::cAutoIPtr(&pTraitManager, Aggregated); if ( config_spew_on && CfgSpewTest(aAigunspew_0) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d: Taking shot\n", ID); } projID = j__GetProjectile(this->m_gunID); if ( projID ) { qmemcpy(&launchParams, &g_defaultLaunchParams, sizeof(launchParams)); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); + v3 = cAIState::GetID(this->m_pAIState); j__VHotGetLoc(&launchParams.loc, v3, 0); launchParams.error = this->m_pAIGunDesc->m_aimError; launchParams.flags = 112; @@ -350196,13 +349939,13 @@ void __thiscall cAIGunAction::Shoot(cAIGunAction *this) oktocalc = 1; if ( !g_pPhysAttrProp->Get(g_pPhysAttrProp, projID, &pAttrProp) ) { - v4 = cAIState::GetID((cAIState *)this->m_pAIState); + v4 = cAIState::GetID(this->m_pAIState); DbgReportWarning("cAIGunAction::Shoot(): no physics attributes on projectile %d, for AI %d\n", projID, v4); oktocalc = 0; } if ( !g_pPhysInitVelProp->Get(g_pPhysInitVelProp, projID, &pInitVel) ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); DbgReportWarning("cAIGunAction::Shoot(): no initial velocity on projectile %d, for AI %d\n", projID, v5); oktocalc = 0; } @@ -350212,12 +349955,12 @@ void __thiscall cAIGunAction::Shoot(cAIGunAction *this) CalcArc(&targetDeltaVec, pInitVel->x, pAttrProp->gravity); targetModelVec.z = targetDeltaVec.z + launchParams.loc.z; } - launchParams.pitch = (__int64)(cAIState::PitchTo((cAIState *)this->m_pAIState, &targetModelVec) + launchParams.pitch = (__int64)(cAIState::PitchTo(this->m_pAIState, &targetModelVec) * 360.0 / 6.283185307178 * 32768.0 / 180.0); - v6 = cAIState::GetID((cAIState *)this->m_pAIState); + v6 = cAIState::GetID(this->m_pAIState); pTurretParams = AIGetProperty(g_pAITurretProperty, v6, &g_AIDefaultTurretParams); pitchEpsilon = (int)((__int64)pTurretParams->m_pitchEpsilon << 15) / 180; if ( launchParams.pitch > (int)pitchEpsilon && (unsigned __int16)-launchParams.pitch > (int)pitchEpsilon ) @@ -350227,7 +349970,7 @@ void __thiscall cAIGunAction::Shoot(cAIGunAction *this) else launchParams.pitch = -pitchEpsilon; } - launchParams.heading = (__int64)(cAIState::AngleTo((cAIState *)this->m_pAIState, &result, &targetModelVec)->value + launchParams.heading = (__int64)(cAIState::AngleTo(this->m_pAIState, &result, &targetModelVec)->value * 360.0 / 6.283185307178 * 32768.0 @@ -350236,34 +349979,34 @@ void __thiscall cAIGunAction::Shoot(cAIGunAction *this) { mx_addeq_vec(&launchParams.loc, &this->m_pAIGunDesc->m_fireOffset); v20 = projID; - v10 = cAIState::GetID((cAIState *)this->m_pAIState); + v10 = cAIState::GetID(this->m_pAIState); j__GunLaunchProjectile(v10, v20, &launchParams); - v16 = cAIState::GetID((cAIState *)this->m_pAIState); - v14 = cAIState::GetID((cAIState *)this->m_pAIState); + v16 = cAIState::GetID(this->m_pAIState); + v14 = cAIState::GetID(this->m_pAIState); v21 = cIPtr::operator->(&pTraitManager); v11 = v21->GetArchetype(v21, v14); j__CreateGunFlashes(v11, v16, 0, 0); } else { - v7 = cAIState::GetID((cAIState *)this->m_pAIState); + v7 = cAIState::GetID(this->m_pAIState); pJointPos = j__ObjJointPos(v7); jointHeading = (__int64)(pJointPos[this->m_gunJointID] * 32768.0 / 180.0); mx_rot_z_vec(&fireOffset, &this->m_pAIGunDesc->m_fireOffset, launchParams.heading); mx_addeq_vec(&launchParams.loc, &fireOffset); v18 = projID; - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); j__GunLaunchProjectile(v8, v18, &launchParams); v19 = jointHeading; - v15 = cAIState::GetID((cAIState *)this->m_pAIState); - v13 = cAIState::GetID((cAIState *)this->m_pAIState); + v15 = cAIState::GetID(this->m_pAIState); + v13 = cAIState::GetID(this->m_pAIState); v22 = cIPtr::operator->(&pTraitManager); v9 = v22->GetArchetype(v22, v13); j__CreateGunFlashes(v9, v15, v19, 0); } cTagSet::cTagSet(&tagSet, aEventShoot); m_gunID = this->m_gunID; - v12 = cAIState::GetID((cAIState *)this->m_pAIState); + v12 = cAIState::GetID(this->m_pAIState); ESndPlayObj(&tagSet, v12, m_gunID, 0, 0); cTagSet::~cTagSet(&tagSet); cAutoIPtr::~cAutoIPtr(&pTraitManager); @@ -350286,7 +350029,7 @@ void __thiscall cAIGunAction::SetState(cAIGunAction *this, int state) if ( CfgSpewTest(aAigunspew_1) ) { m_state = this->m_state; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("%d: State from %d to %d\n", ID, m_state, state); } } @@ -350361,7 +350104,7 @@ BOOL __thiscall cAIGunAction::CheckTarget(cAIGunAction *this) int m_targetObj; // [esp-4h] [ebp-8h] m_targetObj = this->m_targetObj; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); return g_pAIAttackLinks->GetSingleLink(g_pAIAttackLinks, ID, m_targetObj) != 0; } @@ -350526,7 +350269,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 97CFBC: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97CFCC: using guessed type void *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0; +// 97CFCC: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0; //----- (00587230) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -350540,7 +350283,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97CFBC: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97CFCC: using guessed type void *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0; +// 97CFCC: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIAlertResponseProperty___1_IID_IAIAlertResponseProperty__3U_GUID__BPAUsAIAlertResponse__V__cHashPropertyStore_V__cClassDataOps_UsAIAlertResponse________6B__cUnknownProperty_UIAIAlertResponseProperty___1_IID_IAIAlertRespo0fec52d0; //----- (005872A0) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -350901,7 +350644,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -350915,7 +350658,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5879D0: using guessed type char var_8[4]; //----- (00587A80) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -350955,7 +350697,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -350973,7 +350715,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -350981,7 +350723,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 587B30: using guessed type char var_C[4]; //----- (00587C10) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -350992,7 +350733,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -351001,7 +350742,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -351016,7 +350757,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 587CA0: variable 'v5' is possibly undefined -// 587C10: using guessed type char var_C[4]; //----- (00587CE0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -351106,7 +350846,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -351121,7 +350861,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 587F00: using guessed type char var_C[4]; //----- (00587F90) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -351152,7 +350891,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -351165,7 +350904,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 587FF0: using guessed type char var_8[4]; //----- (00588080) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -351405,7 +351143,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -351433,7 +351171,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5886D2: variable 'v4' is possibly undefined -// 588630: using guessed type char var_10[4]; //----- (00588730) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -352027,7 +351764,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -352041,7 +351778,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 589420: using guessed type char var_8[4]; //----- (005894D0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -352081,7 +351817,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -352099,7 +351835,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -352107,7 +351843,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 589580: using guessed type char var_C[4]; //----- (00589660) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -352118,7 +351853,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -352127,7 +351862,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -352142,7 +351877,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5896F0: variable 'v5' is possibly undefined -// 589660: using guessed type char var_C[4]; //----- (00589730) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -352232,7 +351966,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -352247,7 +351981,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 589950: using guessed type char var_C[4]; //----- (005899E0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -352278,7 +352011,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -352288,7 +352021,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 589A40: using guessed type char var_8[4]; //----- (00589AD0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -352527,7 +352259,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -352555,7 +352287,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 58A122: variable 'v4' is possibly undefined -// 58A080: using guessed type char var_10[4]; //----- (0058A180) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -352843,7 +352574,7 @@ int __stdcall cAIConverse::SuggestActions( { if ( config_spew_on && CfgSpewTest(aConvactor) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("Actor %d (obj %d) creating new pseudo script action\n", this->m_actorID, ID); } pAction = cAIActorBase::CreatePsdScrAction(this, 0); @@ -352862,7 +352593,7 @@ int __stdcall cAIConverse::SuggestActions( { if ( sAIPsdScrAct::GetArg(&this->m_pActionScript[i], 0) ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); j__SpeechInstallEndCallback(v5, cAIConverse::SpeechEndCallback); } } @@ -352879,7 +352610,7 @@ void __stdcall cAIConverse::OnActionChange(cAIConverse *this, IAIAction *pPrevio } //----- (0058A7BC) -------------------------------------------------------- -void __stdcall cAIConverse::Start(cAIConverse *this, IInternalAI *pConversation, int actorID) +void __stdcall cAIConverse::Start(cAIConverse *this, IInternalAI *pConversation, unsigned int actorID) { int ID; // eax int v4; // eax @@ -352960,7 +352691,7 @@ void __thiscall cAIConverse::SetState(cAIConverse *this, eAIConverseState state) if ( config_spew_on && CfgSpewTest(aConvactor_3) ) { v3 = g_converseStateNames[state]; - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); CfgDoSpew("Actor %d (obj %d) to state %s\n", this->m_actorID, ID, v3); } if ( state == kAIConvFinishedAction ) @@ -353215,7 +352946,7 @@ void __thiscall cSpecificPropertymStore); } // 97DCB4: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97DCC4: using guessed type void *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5; +// 97DCC4: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5; //----- (0058B2C0) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -353229,7 +352960,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97DCB4: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97DCC4: using guessed type void *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5; +// 97DCC4: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAISenseCombatResponseProperty___1_IID_IAISenseCombatResponseProperty__3U_GUID__BPAUsAISenseCombatResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISenseCombatResponse________6B__cUnknownProperty_UIAISenseCombatResponse59c7c8a5; //----- (0058B330) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -353590,7 +353321,7 @@ sDatum *__stdcall cHashPropertyStore>::Cre sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -353604,7 +353335,6 @@ sDatum *__stdcall cHashPropertyStore>::Cre result->value = val.value; return result; } -// 58BA60: using guessed type char var_8[4]; //----- (0058BB10) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -353644,7 +353374,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -353662,7 +353392,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -353670,7 +353400,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 58BBC0: using guessed type char var_C[4]; //----- (0058BCA0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -353681,7 +353410,7 @@ sDatum *__stdcall cHashPropertyStore>::Cop { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -353690,7 +353419,7 @@ sDatum *__stdcall cHashPropertyStore>::Cop sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -353705,7 +353434,6 @@ sDatum *__stdcall cHashPropertyStore>::Cop return result; } // 58BD30: variable 'v5' is possibly undefined -// 58BCA0: using guessed type char var_C[4]; //----- (0058BD70) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -353795,7 +353523,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -353810,7 +353538,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 58BF90: using guessed type char var_C[4]; //----- (0058C020) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -353841,7 +353568,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -353854,7 +353581,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 58C080: using guessed type char var_8[4]; //----- (0058C110) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -354101,7 +353827,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -354129,7 +353855,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 58C762: variable 'v4' is possibly undefined -// 58C6C0: using guessed type char var_10[4]; //----- (0058C7C0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -354338,7 +354063,7 @@ int __stdcall cAIDeath::SuggestActions(cAIDeath *this, cAIGoal *pGoal, const cAI { v11 = this->m_pAI->AccessSoundEnactor(this->m_pAI); v11->HaltCurrent(v11); - if ( cAIState::GetAlertness((cAIState *)this->m_pAIState) < kAIAL_Low || this->m_DeathCause == 2 ) + if ( cAIState::GetAlertness(this->m_pAIState) < kAIAL_Low || this->m_DeathCause == 2 ) { v10 = ((int (__stdcall *)(IInternalAI *, int, _DWORD))this->m_pAI->AccessSoundEnactor)(this->m_pAI, 28, 0); (*(void (__stdcall **)(int))(*(_DWORD *)v10 + 188))(v10); @@ -354541,7 +354266,7 @@ void __thiscall cAIDefend::Seek(cAIDefend *this) GetObjLocation(pPoint->object, &pPoint->location); if ( (!this->m_fDefending || pPoint->iActive == 3) && (this->m_fDefending || pPoint->iActive != 3) ) _CriticalMsg(aDefendInconsis, aRPrjThief2Skup_1823, 0xC8u); - alertness = cAIState::GetAlertness((cAIState *)this->m_pAIState); + alertness = cAIState::GetAlertness(this->m_pAIState); for ( i = 0; i < 3 && (!pPoint->ranges[i].radius || alertness < pPoint->ranges[i].minAlert || alertness > pPoint->ranges[i].maxAlert); @@ -354563,7 +354288,7 @@ void __thiscall cAIDefend::Seek(cAIDefend *this) { halfHeight = (float)(pPoint->ranges[i].height / 2); radiusSq = (float)(pPoint->ranges[i].radius * pPoint->ranges[i].radius); - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); pPoint->fInRange = AIInsideCylinder(Location, &pPoint->location, radiusSq, halfHeight, &pPoint->distSq); if ( !this->m_fDefending || iPrevActive != pPoint->iActive ) this->m_pAI->NotifyDefend(this->m_pAI, pPoint); @@ -354644,8 +354369,8 @@ int __cdecl AIInitFleeAbility() IAIFleeConditionsProperty *v0; // eax IAIFleeConditionsProperty *v2; // [esp+4h] [ebp-148h] cAIFleeConditionsProperty *v3; // [esp+8h] [ebp-144h] - IUnknown *v4; // [esp+Ch] [ebp-140h] - IUnknown *Aggregated; // [esp+10h] [ebp-13Ch] + IStructDescTools *v4; // [esp+Ch] [ebp-140h] + IStructDescTools *Aggregated; // [esp+10h] [ebp-13Ch] IStructDescTools *tools; // [esp+14h] [ebp-138h] sRelationDesc fleeSourceDesc; // [esp+18h] [ebp-134h] BYREF sRelationDesc fleeToDesc; // [esp+44h] [ebp-108h] BYREF @@ -354659,14 +354384,12 @@ int __cdecl AIInitFleeAbility() tools->Register(tools, &g_AIFleeConditionsStructDesc); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_NoFleeLinkStructDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_NoFleeLinkStructDesc); if ( Aggregated ) Aggregated->Release(Aggregated); - v4 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v4->__vftable[5].QueryInterface)(v4, &g_FleeDestLinkStructDesc); + v4 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v4->Register(v4, &g_FleeDestLinkStructDesc); if ( v4 ) v4->Release(v4); strcpy(fleeSourceDesc.name, "AIFleeSource"); @@ -354892,7 +354615,7 @@ void __stdcall cAIFlee::OnActionProgress(cAIFlee *this, IAIAction *pAction) if ( (pAwareness->flags & 4) != 0 ) v5 = 0; else - v5 = sAIAwareness::TimeSinceContact((sAIAwareness *)pAwareness); + v5 = sAIAwareness::TimeSinceContact(pAwareness); timeSinceContact = v5; if ( pAwareness->level == kAIAL_High && (pAwareness->flags & 4) != 0 && pAction->GetType(pAction) == 11 ) { @@ -354905,7 +354628,7 @@ void __stdcall cAIFlee::OnActionProgress(cAIFlee *this, IAIAction *pAction) else if ( fFleeDestReached && pAction->GetResult(pAction) > kAIR_NoResultSwitch && ((GetObjLocation(fleeSource, &sourceLoc), (pAwareness->flags & 4) != 0) || timeSinceContact < 0x3E8) - && cAIState::DistSq((cAIState *)this->m_pAIState, &sourceLoc) < 625.0 ) + && cAIState::DistSq(this->m_pAIState, &sourceLoc) < 625.0 ) { cAIAbility::SignalGoal(this); } @@ -355260,7 +354983,7 @@ int __stdcall cAIFlee::SuggestActions(cAIFlee *this, cAIGoal *pGoal, const cAIAc IAIAction *const *v5; // eax unsigned int v6; // eax int ID; // eax - int v8; // [esp+4h] [ebp-30h] + BOOL v8; // [esp+4h] [ebp-30h] IAIAction *v9; // [esp+8h] [ebp-2Ch] BYREF IAIAction *item; // [esp+Ch] [ebp-28h] BYREF int v11; // [esp+10h] [ebp-24h] @@ -355400,7 +355123,7 @@ BOOL __thiscall cAIFlee::CheckFriendsNotFlee(cAIFlee *this, const sAIFleeConditi { v5 = (int **)cDABase>::operator[](&awarenesses, i); ObjLocation = GetObjLocation(**v5); - dist = cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation); + dist = cAIState::DistSq(this->m_pAIState, ObjLocation); if ( dist < 400.0 ) nFriends = 1; break; @@ -355516,7 +355239,7 @@ int __thiscall cAIFlee::PickFleePoint(cAIFlee *this, int source) GetObjLocation(source, &sourceLoc); ID = cAIComponentBase::GetID(this); GetObjLocation(ID, &curLoc); - startCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); + startCell = cAIState::GetPathCell(this->m_pAIState); if ( !this->bFiguringDest ) { for ( i = 0; ; ++i ) @@ -355575,7 +355298,7 @@ int __thiscall cAIFlee::PickFleePoint(cAIFlee *this, int source) cAILocoAction::StrokeDest(&iterPoint, &hintCell, FleePointId); v11 = this->m_pAI->AccessPathfinder(this->m_pAI); v10 = v11->AccessControl(v11); - StressBits = cAIState::GetStressBits((cAIState *)this->m_pAIState); + StressBits = cAIState::GetStressBits(this->m_pAIState); this->m_pPath = AIPathfind(&curLoc, startCell, &iterPoint, 0, StressBits | 1, v10); if ( this->m_pPath ) { @@ -355993,7 +355716,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 97E444: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97E454: using guessed type void *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc; +// 97E454: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc; //----- (00590660) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -356007,7 +355730,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97E444: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97E454: using guessed type void *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc; +// 97E454: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeConditionsProperty__3U_GUID__BPAUsAIFleeConditions__V__cHashPropertyStore_V__cClassDataOps_UsAIFleeConditions________6B__cUnknownProperty_UIAIFleeConditionsProperty___1_IID_IAIFleeC521087bc; //----- (005906D0) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -356368,7 +356091,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -356382,7 +356105,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 590E00: using guessed type char var_8[4]; //----- (00590EB0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -356422,7 +356144,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -356440,7 +356162,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -356448,7 +356170,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 590F60: using guessed type char var_C[4]; //----- (00591040) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -356459,7 +356180,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -356468,7 +356189,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -356483,7 +356204,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5910D0: variable 'v5' is possibly undefined -// 591040: using guessed type char var_C[4]; //----- (00591110) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -356573,7 +356293,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -356588,7 +356308,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 591330: using guessed type char var_C[4]; //----- (005913C0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -356619,7 +356338,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -356632,7 +356351,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 591420: using guessed type char var_8[4]; //----- (005914B0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -356881,7 +356599,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -356909,7 +356627,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 591B0C: variable 'v4' is possibly undefined -// 591A70: using guessed type char var_10[4]; //----- (00591B70) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -357325,12 +357042,12 @@ void __stdcall cAIFreeze::OnGoalChange(cAIFreeze *this, const cAIGoal *pPrevious cAutoIPtr::cAutoIPtr(&pScriptMan, Aggregated); if ( cAIAbility::IsLosingControl(this, pPrevious, pGoal) ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); j__CreatureUnFreeze(ID); v18 = (sScrMsg *)j__new(0x38u, aRPrjThief2Skup_1810, 185); if ( v18 ) { - v5 = cAIState::GetID((cAIState *)this->m_pAIState); + v5 = cAIState::GetID(this->m_pAIState); sScrMsg::sScrMsg(v18, v5, aUnfreeze); v16 = v6; } @@ -357347,12 +357064,12 @@ void __stdcall cAIFreeze::OnGoalChange(cAIFreeze *this, const cAIGoal *pPrevious } else if ( cAIAbility::IsGainingControl(this, pPrevious, pGoal) ) { - v8 = cAIState::GetID((cAIState *)this->m_pAIState); + v8 = cAIState::GetID(this->m_pAIState); j__CreatureFreeze(v8); v17 = (sScrMsg *)j__new(0x38u, aRPrjThief2Skup_1811, 193); if ( v17 ) { - v9 = cAIState::GetID((cAIState *)this->m_pAIState); + v9 = cAIState::GetID(this->m_pAIState); sScrMsg::sScrMsg(v17, v9, aFreeze); v14 = v10; } @@ -357365,7 +357082,7 @@ void __stdcall cAIFreeze::OnGoalChange(cAIFreeze *this, const cAIGoal *pPrevious v14->flags = v11; v13 = cIPtr::operator->(&pScriptMan); v13->PostMessage(v13, v14); - v12 = cAIState::GetID((cAIState *)this->m_pAIState); + v12 = cAIState::GetID(this->m_pAIState); SpeechHalt(v12); } cAutoIPtr::~cAutoIPtr(&pScriptMan); @@ -357386,7 +357103,7 @@ eAIResult __stdcall cAIFreeze::UpdateGoal(cAIFreeze *this, cAIGoal *pGoal) { int ID; // eax - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( !AIIsFrozen(ID) ) cAIAbility::SignalGoal(this); return pGoal->result; @@ -357400,7 +357117,7 @@ int __stdcall cAIFreeze::SuggestGoal(cAIFreeze *this, cAIGoal *pPrevious, cAIGoa cAIGoal *v6; // [esp+0h] [ebp-8h] cAIFleeGoal *v7; // [esp+4h] [ebp-4h] - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); if ( AIIsFrozen(ID) ) { v7 = (cAIFleeGoal *)j__new(0x38u, aRPrjThief2Skup_1812, 233); @@ -357893,7 +357610,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -357907,7 +357624,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 593360: using guessed type char var_8[4]; //----- (00593410) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -357947,7 +357663,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -357962,7 +357678,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -357970,7 +357686,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5934C0: using guessed type char var_C[4]; //----- (005935A0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -357981,7 +357696,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -357990,7 +357705,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -358005,7 +357720,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 593630: variable 'v5' is possibly undefined -// 5935A0: using guessed type char var_C[4]; //----- (00593670) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset(cHashPropertyStore > *this) @@ -358094,7 +357808,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -358106,7 +357820,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 593890: using guessed type char var_C[4]; //----- (00593920) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion(cPropertyStore > *this) @@ -358136,7 +357849,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -358146,7 +357859,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 593980: using guessed type char var_8[4]; //----- (00593A10) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -358396,7 +358108,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -358424,7 +358136,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 59405C: variable 'v4' is possibly undefined -// 593FC0: using guessed type char var_10[4]; //----- (005940C0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -358502,7 +358213,7 @@ int __cdecl AIInitIdleAbility() IAIIdleDirsProperty *v4; // [esp+4h] [ebp-14h] cAIIdleOriginProperty *v5; // [esp+8h] [ebp-10h] cAIIdleDirsProperty *v6; // [esp+Ch] [ebp-Ch] - IUnknown *Aggregated; // [esp+10h] [ebp-8h] + IStructDescTools *Aggregated; // [esp+10h] [ebp-8h] IStructDescTools *tools; // [esp+14h] [ebp-4h] cTag::Set(&g_AIFidgetTags, aIdlegesture_0, 0); @@ -358510,10 +358221,8 @@ int __cdecl AIInitIdleAbility() tools->Register(tools, &g_AIIdleDirsStructDesc); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_AIIdleOriginStructDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_AIIdleOriginStructDesc); if ( Aggregated ) Aggregated->Release(Aggregated); v6 = (cAIIdleDirsProperty *)j__new(0xF0u, aRPrjThief2Skup_1803, 231); @@ -358676,8 +358385,8 @@ void __stdcall cAIIdle::OnGoalChange(cAIIdle *this, const cAIGoal *pPrevious, co ID = cAIComponentBase::GetID(this); if ( !AIGetProperty(g_pAIIdleOriginProperty, ID, 0) ) { - facing = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value * 360.0 / 6.283185307178; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + facing = cAIState::GetFacingAng(this->m_pAIState, &result)->value * 360.0 / 6.283185307178; + Location = cAIState::GetLocation(this->m_pAIState); v4 = cAIComponentBase::GetID(this); AISetIdleOrigin(v4, Location, facing); } @@ -358701,7 +358410,7 @@ void __stdcall cAIIdle::OnActionProgress(cAIIdle *this, cAIMoveAction *pAction) const floatang *FacingAng; // eax floatang v6; // [esp-8h] [ebp-2Ch] BYREF floatang v7; // [esp-4h] [ebp-28h] BYREF - int v8; // [esp+0h] [ebp-24h] + BOOL v8; // [esp+0h] [ebp-24h] floatang result; // [esp+4h] [ebp-20h] BYREF floatarc arc; // [esp+10h] [ebp-14h] BYREF const sAIMoveGoal *goal; // [esp+18h] [ebp-Ch] @@ -358741,7 +358450,7 @@ void __stdcall cAIIdle::OnActionProgress(cAIIdle *this, cAIMoveAction *pAction) v6.value = v4; floatang::floatang(&v6, &goal->dir); floatarc::SetByCenterAndSpan(&arc, v6, v7); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &result); fSignal = floatarc::contains(&arc, FacingAng); } } @@ -358773,12 +358482,12 @@ int __stdcall cAIIdle::SuggestGoal(cAIIdle *this, cAIGoal *pPrevious, cAIGoal ** ID = cAIComponentBase::GetID(this); if ( !AIGetProperty(g_pAIIdleOriginProperty, ID, 0) ) { - facing = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &result)->value * 360.0 / 6.283185307178; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + facing = cAIState::GetFacingAng(this->m_pAIState, &result)->value * 360.0 / 6.283185307178; + Location = cAIState::GetLocation(this->m_pAIState); v4 = cAIComponentBase::GetID(this); AISetIdleOrigin(v4, Location, facing); } - if ( cAIState::GetMode((cAIState *)this->m_pAIState) <= kAIM_Normal ) + if ( cAIState::GetMode(this->m_pAIState) <= kAIM_Normal ) { v10 = (cAIIdleGoal *)j__new(0x38u, aRPrjThief2Skup_1806, 430); if ( v10 ) @@ -358821,8 +358530,8 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc float v14; // ecx int v15; // eax int v16; // eax - float accuracySq; // [esp+Ch] [ebp-94h] BYREF - float v[2]; // [esp+10h] [ebp-90h] BYREF + floatang accuracySq; // [esp+Ch] [ebp-94h] BYREF + floatang v[2]; // [esp+10h] [ebp-90h] BYREF int v20; // [esp+18h] [ebp-88h] float v21; // [esp+1Ch] [ebp-84h] sAIMoveSuggestion *v22; // [esp+20h] [ebp-80h] @@ -358879,9 +358588,9 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc cAILocoAction::Set(pLocoOrigin, &dest, kAIS_Normal, 9.0, 6.0833001); v26 = pOrigin->facing * 6.283185307178 / 360.0; floatang::floatang(&v30, v26); - v[0] = v7; - floatang::floatang((floatang *)v, v8); - cAIOrientAction::Set(pOrientOrigin, LODWORD(v[0])); + v[0] = LODWORD(v7); + floatang::floatang(v, v8); + cAIOrientAction::Set(pOrientOrigin, v[0]); cAISeqAction::Add(pSeqAction, pLocoOrigin); cAISeqAction::Add(pSeqAction, pOrientOrigin); pLocoOrigin->Release(pLocoOrigin); @@ -358909,10 +358618,10 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc else speed = kAIS_Fast; v24 = pDefend->ranges[pDefend->iActive].height / 2; - v[0] = (float)v24; + v[0].value = (float)v24; v23 = pDefend->ranges[pDefend->iActive].radius * pDefend->ranges[pDefend->iActive].radius; - accuracySq = (float)v23; - cAILocoAction::Set(pGotoDefend, pDefend->object, speed, accuracySq, v[0]); + accuracySq.value = (float)v23; + cAILocoAction::Set(pGotoDefend, pDefend->object, speed, accuracySq.value, v[0].value); pAction = pGotoDefend; cAITimer::Reset(&this->m_DefendTimer); cAIRandomTimer::Reset(&this->m_DirTimer); @@ -358922,9 +358631,9 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc } if ( !pAction && cAIRandomTimer::Expired(&this->m_DirTimer) ) { - v[0] = 0.0; + v[0].value = 0.0; v10 = cAIComponentBase::GetID(this); - *(float *)&pDirs = COERCE_FLOAT(AIGetProperty(g_pAIIdleDirsProperty, v10, (sAIIdleDirs *)LODWORD(v[0]))); + *(float *)&pDirs = COERCE_FLOAT(AIGetProperty(g_pAIIdleDirsProperty, v10, (sAIIdleDirs *)LODWORD(v[0].value))); if ( *(float *)&pDirs != 0.0 ) { cDynArray::cDynArray(&picks); @@ -358952,12 +358661,12 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc pSuggestion = v22; sAIMoveSuggestion::SetWeightedBias(v22, 1u, 100); pSuggestion->speed = kAIS_Stopped; - v[0] = v14; - floatang::floatang((floatang *)v, 0.017453292); + v[0] = LODWORD(v14); + floatang::floatang(v, 0.017453292); v21 = (double)pDirs->dirs[pick].dir * 6.283185307178 / 360.0; - accuracySq = *(float *)&pDirs; - floatang::floatang((floatang *)&accuracySq, v21); - floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, LODWORD(accuracySq), LODWORD(v[0])); + *(const sAIIdleDirs **)&accuracySq.value = pDirs; + floatang::floatang(&accuracySq, v21); + floatarc::SetByCenterAndSpan(&pSuggestion->dirArc, accuracySq, v[0]); cAIMoveAction::Add(pTurn, pSuggestion); cAITimer::Reset(&this->m_TurnTimeout); pAction = pTurn; @@ -358973,11 +358682,11 @@ int __stdcall cAIIdle::SuggestActions(cAIIdle *this, cAIGoal *pGoal, const cAIAc { if ( cAIRandomTimer::Expired(&this->m_GestureTimer) ) { - LODWORD(v[0]) = 1; + LODWORD(v[0].value) = 1; v16 = cAIComponentBase::GetID(this); - if ( AIGetProperty(g_pAIFidgetProperty, v16, SLODWORD(v[0])) ) + if ( AIGetProperty(g_pAIFidgetProperty, v16, SLODWORD(v[0].value)) ) { - if ( cAIState::GetMode((cAIState *)this->m_pAIState) > kAIM_Efficient ) + if ( cAIState::GetMode(this->m_pAIState) > kAIM_Efficient ) { pMoveEnactor = this->m_pAI->AccessMoveEnactor(this->m_pAI); if ( pMoveEnactor ) @@ -359858,7 +359567,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -359872,7 +359581,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 596430: using guessed type char var_8[4]; //----- (005964E0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -359912,7 +359620,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -359930,7 +359638,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -359938,7 +359646,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 596590: using guessed type char var_C[4]; //----- (00596670) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -359949,7 +359656,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -359958,7 +359665,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -359973,7 +359680,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 596700: variable 'v5' is possibly undefined -// 596670: using guessed type char var_C[4]; //----- (00596740) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -360063,7 +359769,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -360075,7 +359781,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 596960: using guessed type char var_C[4]; //----- (005969F0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -360106,7 +359811,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -360116,7 +359821,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 596A50: using guessed type char var_8[4]; //----- (00596AE0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -360207,7 +359911,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -360221,7 +359925,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 596C80: using guessed type char var_8[4]; //----- (00596D30) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -360261,7 +359964,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -360279,7 +359982,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -360287,7 +359990,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 596DE0: using guessed type char var_C[4]; //----- (00596EC0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -360298,7 +360000,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -360307,7 +360009,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -360322,7 +360024,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 596F50: variable 'v5' is possibly undefined -// 596EC0: using guessed type char var_C[4]; //----- (00596F90) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -360412,7 +360113,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -360424,7 +360125,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5971B0: using guessed type char var_C[4]; //----- (00597240) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -360455,7 +360155,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -360465,7 +360165,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5972A0: using guessed type char var_8[4]; //----- (00597330) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -360771,7 +360470,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -360799,7 +360498,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 597B3C: variable 'v4' is possibly undefined -// 597AA0: using guessed type char var_10[4]; //----- (00597BA0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -360945,7 +360643,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -360973,7 +360671,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 597F7C: variable 'v4' is possibly undefined -// 597EE0: using guessed type char var_10[4]; //----- (00597FE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -361267,7 +360964,7 @@ void __stdcall cAIInvestigate::OnActionProgress(cAIInvestigate *this, cAIInvestA fSignal = cAIRandomTimer::Expired(&this->m_MaxResyncTimer); } if ( ((int (__thiscall *)(IInternalAI *, IInternalAI *))this->m_pAI->AccessSenses)(this->m_pAI, this->m_pAI) - && cAIState::GetAlertness((cAIState *)this->m_pAIState) >= kAIAL_Moderate + && cAIState::GetAlertness(this->m_pAIState) >= kAIAL_Moderate && cAIRandomTimer::Expired(&this->m_MaxSenseResyncTimer) ) { cAIRandomTimer::Reset(&this->m_MaxSenseResyncTimer); @@ -361313,8 +361010,8 @@ int __stdcall cAIInvestigate::SuggestGoal(cAIInvestigate *this, cAIGoal *pPrevio cAIGoal *v7; // eax cAIGoal *v8; // [esp+0h] [ebp-10h] cAIInvestigateGoal *v9; // [esp+4h] [ebp-Ch] - sAIAwareness *pAwareness; // [esp+8h] [ebp-8h] - sAIDefendPoint *pDefend; // [esp+Ch] [ebp-4h] + const sAIAwareness *pAwareness; // [esp+8h] [ebp-8h] + const sAIDefendPoint *pDefend; // [esp+Ch] [ebp-4h] if ( (cAIComponentBase::GetNotifications(this) & 4) == 0 ) _CriticalMsg(aGetnotificatio, aRPrjThief2Skup_1801, 0xFAu); @@ -361323,11 +361020,11 @@ int __stdcall cAIInvestigate::SuggestGoal(cAIInvestigate *this, cAIGoal *pPrevio AIGetProperty(g_pAIInvestKindProperty, v3, 0) != 1) ) { AlertnessSource = cAIInvestigate::GetAlertnessSource(this); - pAwareness = (sAIAwareness *)this->m_pAI->GetAwareness(this->m_pAI, AlertnessSource); + pAwareness = this->m_pAI->GetAwareness(this->m_pAI, AlertnessSource); if ( sAIAwareness::ValidLastPos(pAwareness) && sAIAwareness::TimeSinceContact(pAwareness) <= g_AITimeBreakInvestigation && ((ID = cAIComponentBase::GetID(this), - (pDefend = (sAIDefendPoint *)AIGetDefendPoint(ID)) == 0) + (pDefend = AIGetDefendPoint(ID)) == 0) || pDefend->fInRange || sAIDefendPoint::InRange(pDefend, &pAwareness->lastPos)) ) { @@ -361374,7 +361071,7 @@ int __stdcall cAIInvestigate::SuggestActions( cAIActions *pNew) { const mxs_vector *Dest; // eax - int v6; // [esp+0h] [ebp-1Ch] + BOOL v6; // [esp+0h] [ebp-1Ch] IAIAction *item; // [esp+4h] [ebp-18h] BYREF float distKeepFreshSense; // [esp+8h] [ebp-14h] IAISenses *pSenses; // [esp+Ch] [ebp-10h] @@ -361429,7 +361126,7 @@ void __thiscall cAIInvestigate::BroadcastAlertness(cAIInvestigate *this) cTagSet investigateTags; // [esp+8h] [ebp-Ch] BYREF unsigned int concept; // [esp+10h] [ebp-4h] - concept = alertToConcept[cAIState::GetAlertness((cAIState *)this->m_pAIState)]; + concept = alertToConcept[cAIState::GetAlertness(this->m_pAIState)]; if ( this->m_pAI->AccessSoundEnactor(this->m_pAI) ) { if ( concept != 41 ) @@ -361687,7 +361384,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 97FC58: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97FC68: using guessed type void *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa; +// 97FC68: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa; //----- (00599340) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -361701,7 +361398,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 97FC58: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 97FC68: using guessed type void *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa; +// 97FC68: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAISignalResponseProperty___1_IID_IAISignalResponseProperty__3U_GUID__BPAUsAISignalResponse__V__cHashPropertyStore_V__cClassDataOps_UsAISignalResponse________6B__cUnknownProperty_UIAISignalResponseProperty___1_IID_IAISigna43f95aaa; //----- (005993B0) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -362062,7 +361759,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -362076,7 +361773,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 599AE0: using guessed type char var_8[4]; //----- (00599B90) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -362116,7 +361812,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -362134,7 +361830,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -362142,7 +361838,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 599C40: using guessed type char var_C[4]; //----- (00599D20) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -362153,7 +361848,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -362162,7 +361857,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -362177,7 +361872,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 599DB0: variable 'v5' is possibly undefined -// 599D20: using guessed type char var_C[4]; //----- (00599DF0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -362267,7 +361961,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -362282,7 +361976,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 59A010: using guessed type char var_C[4]; //----- (0059A0A0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -362313,7 +362006,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -362326,7 +362019,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 59A100: using guessed type char var_8[4]; //----- (0059A190) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -362566,7 +362258,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -362594,7 +362286,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 59A7E2: variable 'v4' is possibly undefined -// 59A740: using guessed type char var_10[4]; //----- (0059A840) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -362909,7 +362600,7 @@ void __thiscall cAINonCombatAbility::cAINonCombatAbility(cAINonCombatAbility *th //----- (0059AFDC) -------------------------------------------------------- void __stdcall cAINonCombatAbility::OnBeginFrame(cAINonCombatAbility *this) { - if ( cAIState::GetMode((cAIState *)this->m_pAIState) >= kAIM_Normal && this->InControl(this) ) + if ( cAIState::GetMode(this->m_pAIState) >= kAIM_Normal && this->InControl(this) ) { if ( cAITimer::Expired(&this->m_BroadcastTimer) ) { @@ -362991,7 +362682,7 @@ void __thiscall cAINonCombatAbility::BroadcastAlertness(cAINonCombatAbility *thi int v1; // [esp+0h] [ebp-Ch] unsigned int concept; // [esp+8h] [ebp-4h] - concept = alertToConcept_0[cAIState::GetAlertness((cAIState *)this->m_pAIState)]; + concept = alertToConcept_0[cAIState::GetAlertness(this->m_pAIState)]; if ( this->m_pAI->AccessSoundEnactor(this->m_pAI) ) { if ( concept != 41 ) @@ -363229,7 +362920,7 @@ BOOL __stdcall cAIPatrol::SuggestGoal(cAIPatrol *this, cAIGoal *pCurrentGoal, cA ID = cAIComponentBase::GetID(this); if ( AIGetDefendPoint(ID) ) return 1; - if ( cAIState::GetMode((cAIState *)this->m_pAIState) > kAIM_Normal ) + if ( cAIState::GetMode(this->m_pAIState) > kAIM_Normal ) return 1; if ( cAIPatrol::ShouldPatrol(this) ) { @@ -363510,7 +363201,7 @@ int __thiscall cAIPatrol::TargetNextPatrolObj(cAIPatrol *this) { minDistSq = 3.4028235e38; cMxsVector::cMxsVector(&sourceLoc); - loc = cAIState::GetLocation((cAIState *)this->m_pAIState); + loc = cAIState::GetLocation(this->m_pAIState); v10 = g_pAIPatrolLinks->Query(g_pAIPatrolLinks, 0, 0); cAutoIPtr::operator=(&pLinkQuery, v10); while ( 1 ) @@ -363896,9 +363587,9 @@ void __stdcall cAISuspiciousResponse::Init(cAISuspiciousResponse *this) void __stdcall cAISuspiciousResponse::OnFoundSuspicious(cAISuspiciousResponse *this, int object) { int ID; // eax - int v3; // eax + size_t v3; // eax const char *v4; // eax - int v5; // eax + size_t v5; // eax const char *v6; // eax cAnsiStr newstring; // [esp+0h] [ebp-10A0h] BYREF int result; // [esp+Ch] [ebp-1094h] @@ -364391,7 +364082,7 @@ sDatum *__stdcall cHashPropertyStore>::Crea sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -364405,7 +364096,6 @@ sDatum *__stdcall cHashPropertyStore>::Crea result->value = val.value; return result; } -// 59D770: using guessed type char var_8[4]; //----- (0059D820) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -364445,7 +364135,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -364463,7 +364153,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -364471,7 +364161,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 59D8D0: using guessed type char var_C[4]; //----- (0059D9B0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -364482,7 +364171,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -364491,7 +364180,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -364506,7 +364195,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy return result; } // 59DA40: variable 'v5' is possibly undefined -// 59D9B0: using guessed type char var_C[4]; //----- (0059DA80) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -364596,7 +364284,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -364611,7 +364299,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 59DCA0: using guessed type char var_C[4]; //----- (0059DD30) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -364642,7 +364329,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -364655,7 +364342,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 59DD90: using guessed type char var_8[4]; //----- (0059DE20) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -364900,7 +364586,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -364928,7 +364614,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 59E472: variable 'v4' is possibly undefined -// 59E3D0: using guessed type char var_10[4]; //----- (0059E4D0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -365556,7 +365241,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -365570,7 +365255,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 59F260: using guessed type char var_8[4]; //----- (0059F310) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -365610,7 +365294,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -365628,7 +365312,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -365636,7 +365320,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 59F3C0: using guessed type char var_C[4]; //----- (0059F4A0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -365647,7 +365330,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -365656,7 +365339,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -365671,7 +365354,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 59F530: variable 'v5' is possibly undefined -// 59F4A0: using guessed type char var_C[4]; //----- (0059F570) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -365761,7 +365443,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -365776,7 +365458,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 59F790: using guessed type char var_C[4]; //----- (0059F820) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -365807,7 +365488,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -365820,7 +365501,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 59F880: using guessed type char var_8[4]; //----- (0059F910) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -366060,7 +365740,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -366088,7 +365768,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 59FF62: variable 'v4' is possibly undefined -// 59FEC0: using guessed type char var_10[4]; //----- (0059FFC0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -366594,7 +366273,7 @@ int __thiscall cAIWatch::CheckTrigger(cAIWatch *this, sAIWatchPoint *pWatch) int result; // [esp+48h] [ebp-4h] result = 0; - alertness = cAIState::GetAlertness((cAIState *)this->m_pAIState); + alertness = cAIState::GetAlertness(this->m_pAIState); if ( alertness < pWatch->minAlert || alertness > pWatch->maxAlert ) return 0; if ( pWatch->kind ) @@ -367261,7 +366940,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -367275,7 +366954,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5A1EE0: using guessed type char var_8[4]; //----- (005A1F90) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -367315,7 +366993,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -367333,7 +367011,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -367341,7 +367019,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5A2040: using guessed type char var_C[4]; //----- (005A2120) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -367352,7 +367029,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -367361,7 +367038,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -367376,7 +367053,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5A21B0: variable 'v5' is possibly undefined -// 5A2120: using guessed type char var_C[4]; //----- (005A21F0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -367466,7 +367142,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -367478,7 +367154,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5A2410: using guessed type char var_C[4]; //----- (005A24A0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -367509,7 +367184,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -367519,7 +367194,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5A2500: using guessed type char var_8[4]; //----- (005A2590) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -367758,7 +367432,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -367786,7 +367460,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5A2BE2: variable 'v4' is possibly undefined -// 5A2B40: using guessed type char var_10[4]; //----- (005A2C40) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -367882,7 +367555,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -369442,7 +369115,7 @@ unsigned int __fastcall AICreatePlane(const cMxsVector *normal, float constant) //----- (005A5E29) -------------------------------------------------------- unsigned int __fastcall AICreateOrFindPlane(cMxsVector *normal, float constant) { - int i; // [esp+4h] [ebp-4h] + unsigned int i; // [esp+4h] [ebp-4h] i = AIFindFirstPlane(normal, constant); if ( i ) @@ -369543,9 +369216,9 @@ int __thiscall cAIPathDB::SplitCellByLine( int __fastcall EnforceDatabaseQuality(unsigned int cell) { int i; // [esp+4h] [ebp-8h] - int ia; // [esp+4h] [ebp-8h] - int prevCellCount; // [esp+8h] [ebp-4h] - int prevCellCounta; // [esp+8h] [ebp-4h] + signed int ia; // [esp+4h] [ebp-8h] + signed int prevCellCount; // [esp+8h] [ebp-4h] + signed int prevCellCounta; // [esp+8h] [ebp-4h] g_fQualityWatch = cell == g_AIQualityWatch; do @@ -369887,10 +369560,10 @@ eQualityResult __fastcall QualitySplit(unsigned int cell, int iVert1, float lenS sAIPathCell2VertexLink *v27; // eax sAIPathCell *v28; // eax sAIPathCell2VertexLink *v29; // eax - int id; // [esp-4h] [ebp-9Ch] - int v31; // [esp-4h] [ebp-9Ch] - int v32; // [esp-4h] [ebp-9Ch] - int v33; // [esp-4h] [ebp-9Ch] + unsigned int id; // [esp-4h] [ebp-9Ch] + unsigned int v31; // [esp-4h] [ebp-9Ch] + unsigned int v32; // [esp-4h] [ebp-9Ch] + unsigned int v33; // [esp-4h] [ebp-9Ch] size_t v34; // [esp+8h] [ebp-90h] size_t v35; // [esp+8h] [ebp-90h] unsigned __int8 *v36; // [esp+Ch] [ebp-8Ch] @@ -371349,7 +371022,6 @@ int __cdecl AIPathFindDBBuild() // 41186F: using guessed type int j__DeterminePathfindZones(void); // 422935: using guessed type int j__LinkPathfindZones(void); // 42667F: using guessed type int j__ResetPathfindZones(void); -// 5A815B: using guessed type unsigned __int8 okCondBits[4]; //----- (005A9B99) -------------------------------------------------------- void __cdecl PathFindMinimumRaycastAtLocation(const cMxsVector *sampleSourcePt, float *heightSq, float *widthSq) @@ -371625,7 +371297,7 @@ eEdgeProperties __cdecl ComputeEdgeProperty( float fEffectiveHeight2; // [esp+8Ch] [ebp-70h] float fRise1; // [esp+90h] [ebp-6Ch] float fEffectiveHeight1; // [esp+94h] [ebp-68h] - int bSucceeded; // [esp+98h] [ebp-64h] + BOOL bSucceeded; // [esp+98h] [ebp-64h] cMxsVector endPt2; // [esp+9Ch] [ebp-60h] BYREF cMxsVector endPt1; // [esp+A8h] [ebp-54h] BYREF float radius; // [esp+B4h] [ebp-48h] @@ -372163,7 +371835,7 @@ BOOL __cdecl CellIsRamp(int iCellIndex) } //----- (005AB75B) -------------------------------------------------------- -int __cdecl CellBlockedDirections(int iCellIndex) +int __cdecl CellBlockedDirections(unsigned int iCellIndex) { float v1; // ecx int v2; // eax @@ -372486,7 +372158,7 @@ void PostProcessModifiedOkBits() int i; // [esp+18h] [ebp-18h] sAIPathCellLink *pCell1To2Link; // [esp+1Ch] [ebp-14h] int iFirstCell1; // [esp+20h] [ebp-10h] - int bEdgesDoNotIntersect; // [esp+24h] [ebp-Ch] + BOOL bEdgesDoNotIntersect; // [esp+24h] [ebp-Ch] float fZDiff; // [esp+28h] [ebp-8h] BYREF unsigned int cell1; // [esp+2Ch] [ebp-4h] @@ -372578,7 +372250,7 @@ void PostProcessModifiedOkBits() // 5AC25E: conditional instruction was optimized away because %bHighStrikeOnly.4==0 //----- (005AC409) -------------------------------------------------------- -BOOL __cdecl EdgesDoNotIntersect(int iFromCell, sAIPathCellLink *pLink, float *fZDiff) +BOOL __cdecl EdgesDoNotIntersect(unsigned int iFromCell, sAIPathCellLink *pLink, float *fZDiff) { double v3; // st7 float v6; // [esp+4h] [ebp-48h] @@ -372798,8 +372470,8 @@ int __fastcall IsSharedEdge( Vec2 *v27; // [esp-4h] [ebp-4Ch] int v28; // [esp+0h] [ebp-48h] int v29; // [esp+4h] [ebp-44h] - int v30; // [esp+8h] [ebp-40h] - int v31; // [esp+Ch] [ebp-3Ch] + BOOL v30; // [esp+8h] [ebp-40h] + BOOL v31; // [esp+Ch] [ebp-3Ch] float v34; // [esp+18h] [ebp-30h] BYREF float v35; // [esp+1Ch] [ebp-2Ch] BYREF float l; // [esp+20h] [ebp-28h] BYREF @@ -374008,7 +373680,7 @@ void __cdecl AIPathFindRead(ITagFile *pTagFile) int v26; // [esp-4h] [ebp-44h] int v27; // [esp-4h] [ebp-44h] int v28; // [esp-4h] [ebp-44h] - int v29; // [esp-4h] [ebp-44h] + unsigned int v29; // [esp-4h] [ebp-44h] int v30; // [esp-4h] [ebp-44h] int v31; // [esp-4h] [ebp-44h] size_t v32; // [esp-4h] [ebp-44h] @@ -374974,9 +374646,9 @@ void __cdecl SetCellEdgeLinked() } //----- (005B35B0) -------------------------------------------------------- -void __thiscall cMxsVector::Set(cMxsVector *this, float xx, float yy, float zz) +void __thiscall cMxsVector::Set(cMxsVector *this, unsigned int xx, unsigned int yy, float zz) { - *(_QWORD *)&this->x = __PAIR64__(LODWORD(yy), LODWORD(xx)); + *(_QWORD *)&this->x = __PAIR64__(yy, xx); this->z = zz; } @@ -376746,7 +376418,7 @@ int __thiscall cDABase>::SetSize( //----- (005B6D40) -------------------------------------------------------- void __thiscall cDABase>::cDABase>( cDABase > *this, - int size) + unsigned int size) { this->m_pItems = 0; this->m_nItems = 0; @@ -376828,7 +376500,7 @@ void __thiscall cDABase>::FastDeleteIt unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -377569,7 +377241,7 @@ void _E13_14() } //----- (005B81D4) -------------------------------------------------------- -int __cdecl AIPathcastVia( +BOOL __cdecl AIPathcastVia( const mxs_vector *startPoint, unsigned int startCell, const mxs_vector *endPoint, @@ -377583,8 +377255,8 @@ int __cdecl AIPathcastVia( BOOL v10; // [esp+0h] [ebp-2Ch] BOOL v11; // [esp+8h] [ebp-24h] int fAllowBlockedOBBs; // [esp+Ch] [ebp-20h] - int fViaSucceed; // [esp+10h] [ebp-1Ch] - int rv; // [esp+14h] [ebp-18h] + BOOL fViaSucceed; // [esp+10h] [ebp-1Ch] + BOOL rv; // [esp+14h] [ebp-18h] unsigned int prevCell; // [esp+18h] [ebp-14h] unsigned int currentCell; // [esp+1Ch] [ebp-10h] mxs_vector cast; // [esp+20h] [ebp-Ch] BYREF @@ -377626,7 +377298,7 @@ int __cdecl AIPathcastVia( if ( !currentCell ) { *pEndCell = prevCell; - rv = fViaSucceed != 0; + rv = fViaSucceed; goto LABEL_24; } if ( currentCell == -1 ) @@ -378003,7 +377675,7 @@ void __cdecl AIPathFindDrawPath(IAIPath *pPath) pathColor = guiScreenColor(33488896); cMxsVector::cMxsVector(&edgeCenter); cMxsVector::cMxsVector(&p); - *(_QWORD *)&translate.x = 0i64; + *(_QWORD *)&translate.x = 0LL; translate.z = 0.2; if ( pPath->Active(pPath) ) { @@ -378081,7 +377753,7 @@ void __cdecl AIDrawOnePathCell(unsigned int cell, int proxCull) lineColor[1] = guiScreenColor(0x1FFFFFF); lineColor[2] = guiScreenColor(33488896); lineColor[3] = guiScreenColor(0x1FFFFFF); - *(_QWORD *)&translate.x = 0i64; + *(_QWORD *)&translate.x = 0LL; translate.z = 0.050000001; r3_start_object(&translate); r3_start_block(); @@ -378171,7 +377843,7 @@ void __cdecl AIDrawOneCellsLinks(unsigned int cell, int proxCull) LVLColor = guiScreenColor((int)&brush_faces[2176][13].d + 7); HighStrikeColor = guiScreenColor((int)&brush_faces[2108][5].d + 4); cMxsVector::cMxsVector(&connectCenter); - *(_QWORD *)&translate.x = 0i64; + *(_QWORD *)&translate.x = 0LL; translate.z = 0.050000001; cMxsVector::cMxsVector(&cellCenter); cAIPathDB::GetCenter(&g_AIPathDB, cell, &cellCenter); @@ -378559,14 +378231,14 @@ void __cdecl AIDebugDumpCellVertexInfo(int cell_id) } //----- (005B9F9E) -------------------------------------------------------- -void __cdecl AIDebugDumpCellConnectionInfo(int cell_id) +void __cdecl AIDebugDumpCellConnectionInfo(unsigned int cell_id) { const sAIPathCellLink *CellLink; // eax const sAIPathCellLink *v2; // eax unsigned __int16 iFinalCellID; // [esp+0h] [ebp-14h] const sAIPathCell *pCell; // [esp+4h] [ebp-10h] - int i; // [esp+8h] [ebp-Ch] - int ia; // [esp+8h] [ebp-Ch] + signed int i; // [esp+8h] [ebp-Ch] + signed int ia; // [esp+8h] [ebp-Ch] unsigned __int16 iFirstCellID; // [esp+Ch] [ebp-8h] int has_invalid; // [esp+10h] [ebp-4h] @@ -380079,8 +379751,8 @@ IAIPath *__stdcall cAIPathfinder::Pathfind( pControl = &this->cCTDelegating; else pControl = 0; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); return AIPathfind(PathLocation, PathCell, toLocation, endCell, fOkBits, pControl); } @@ -380100,8 +379772,8 @@ IAIPath *__stdcall cAIPathfinder::PathfindNear( pControl = &this->cCTDelegating; else pControl = 0; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); return AIPathfindNear(PathLocation, PathCell, toLocation, fDist, endCell, fOkBits, pControl); } @@ -380120,8 +379792,8 @@ int __stdcall cAIPathfinder::Pathcast( pControl = &this->cCTDelegating; else pControl = 0; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); return AIPathcast(PathLocation, PathCell, endLocation, pEndCell, fOkBits, pControl); } @@ -380137,8 +379809,8 @@ int __stdcall cAIPathfinder::Pathcast(cAIPathfinder *this, const mxs_vector *end pControl = &this->cCTDelegating; else pControl = 0; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); return AIPathcast(PathLocation, PathCell, endLocation, &ignored, fOkBits, pControl); } @@ -380153,8 +379825,8 @@ int __stdcall cAIPathfinder::IsEdgeVisible(cAIPathfinder *this, const cAIPathEdg pControl = &this->cCTDelegating; else pControl = 0; - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - PathLocation = cAIState::GetPathLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + PathLocation = cAIState::GetPathLocation(this->m_pAIState); return AIIsEdgeVisible(PathLocation, PathCell, edge, OkBits, pControl); } @@ -380543,7 +380215,7 @@ unsigned int __fastcall AIFindClosestCell( __int16 v10; // [esp+2h] [ebp-66h] __int16 cell; // [esp+4h] [ebp-64h] __int16 hint; // [esp+6h] [ebp-62h] - int v13; // [esp+8h] [ebp-60h] + BOOL v13; // [esp+8h] [ebp-60h] Location start; // [esp+14h] [ebp-54h] BYREF Location end; // [esp+24h] [ebp-44h] BYREF Position *pPos; // [esp+34h] [ebp-34h] @@ -381510,7 +381182,7 @@ void __cdecl DoDeterminePathfindZones(eAIPathZoneType ZoneType, unsigned __int8 sAIPathCell *pCell; // [esp+18h] [ebp-38h] int last_cell_link; // [esp+20h] [ebp-30h] unsigned int cellID; // [esp+24h] [ebp-2Ch] - int non_zero_links; // [esp+28h] [ebp-28h] + BOOL non_zero_links; // [esp+28h] [ebp-28h] int num_active_cells; // [esp+2Ch] [ebp-24h] unsigned int i; // [esp+30h] [ebp-20h] int ia; // [esp+30h] [ebp-20h] @@ -381614,14 +381286,14 @@ void __cdecl DoDeterminePathfindZones(eAIPathZoneType ZoneType, unsigned __int8 } //----- (005C0DF1) -------------------------------------------------------- -int LinkPathfindZones() +__int32 LinkPathfindZones() { - int result; // eax - int i; // [esp+0h] [ebp-4h] + __int32 result; // eax + eAIPathZoneType i; // [esp+0h] [ebp-4h] - for ( i = 0; i < 4; ++i ) + for ( i = kAIZone_Normal; i < kAIZone_Num; ++i ) { - DoLinkPathfindZones((eAIPathZoneType)i); + DoLinkPathfindZones(i); result = i + 1; } return result; @@ -381866,7 +381538,7 @@ unsigned __int16 *__thiscall cDABase>::cDABase>( cDABase > *this, - int size) + unsigned int size) { this->m_pItems = 0; this->m_nItems = 0; @@ -381877,7 +381549,7 @@ void __thiscall cDABase>::cDABase>::cDABase>( cDABase > *this, - int size) + unsigned int size) { this->m_pItems = 0; this->m_nItems = 0; @@ -382027,7 +381699,7 @@ void __thiscall cAIRoomDB::Read(cAIRoomDB *this, void (__cdecl *movefunc)(void * cDynArray *v2; // eax cDynArray *v3; // eax unsigned int *v4; // eax - int v5; // [esp-4h] [ebp-1Ch] + unsigned int v5; // [esp-4h] [ebp-1Ch] int j; // [esp+4h] [ebp-14h] unsigned int cval; // [esp+8h] [ebp-10h] BYREF int size2; // [esp+Ch] [ebp-Ch] BYREF @@ -382219,10 +381891,10 @@ void __thiscall cAIRoomDB::BuildRoomCellLists(cAIRoomDB *this) unsigned int v16; // eax double v17; // [esp+0h] [ebp-B0h] const mxs_vector *CellVertex; // [esp+4h] [ebp-ACh] - int v19; // [esp+4h] [ebp-ACh] + unsigned int v19; // [esp+4h] [ebp-ACh] mxs_vector *v20; // [esp+4h] [ebp-ACh] float v21; // [esp+4h] [ebp-ACh] - int v22; // [esp+4h] [ebp-ACh] + unsigned int v22; // [esp+4h] [ebp-ACh] float v23; // [esp+10h] [ebp-A0h] mxs_vector result; // [esp+18h] [ebp-98h] BYREF mxs_vector interp_vertex; // [esp+24h] [ebp-8Ch] BYREF @@ -382559,8 +382231,8 @@ void __cdecl AIInitAbilProps() cAINonCombatDmgRespProp *v6; // [esp+Ch] [ebp-18h] cAINonHostilityProperty *v7; // [esp+10h] [ebp-14h] cAIInvestKindProperty *v8; // [esp+14h] [ebp-10h] - IUnknown *v9; // [esp+18h] [ebp-Ch] - IUnknown *Aggregated; // [esp+1Ch] [ebp-8h] + IStructDescTools *v9; // [esp+18h] [ebp-Ch] + IStructDescTools *Aggregated; // [esp+1Ch] [ebp-8h] IStructDescTools *tools; // [esp+20h] [ebp-4h] g_pAIPatrolProperty = j__CreateBoolProperty(&g_AIPatrolPropertyDesc, 2u); @@ -382592,10 +382264,8 @@ void __cdecl AIInitAbilProps() v4 = 0; } g_pAINonHostilityProperty = v4; - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_AINonHostilityStructDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_AINonHostilityStructDesc); if ( Aggregated ) Aggregated->Release(Aggregated); v6 = (cAINonCombatDmgRespProp *)j__new(0xF0u, aRPrjThief2Skup_1750, 259); @@ -382609,8 +382279,8 @@ void __cdecl AIInitAbilProps() v3 = 0; } g_pAINonCombatDmgRespProperty = v3; - v9 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v9->__vftable[5].QueryInterface)(v9, &NonCombatDmgRespDesc); + v9 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v9->Register(v9, &NonCombatDmgRespDesc); if ( v9 ) v9->Release(v9); j__InitAIProjectileRelation(); @@ -383849,7 +383519,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -383863,7 +383533,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5C48F0: using guessed type char var_8[4]; //----- (005C49A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -383893,7 +383562,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -383908,7 +383577,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -383916,7 +383585,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 5C4A50: using guessed type char var_C[4]; //----- (005C4B30) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -383927,7 +383595,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -383936,7 +383604,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cSimpleDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -383951,7 +383619,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5C4BC0: variable 'v5' is possibly undefined -// 5C4B30: using guessed type char var_C[4]; //----- (005C4C00) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -384139,7 +383806,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -384153,7 +383820,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5C5030: using guessed type char var_8[4]; //----- (005C50E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -384191,7 +383857,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -384206,7 +383872,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNonCombatDmgRespOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNonCombatDmgRespOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -384214,7 +383880,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5C5190: using guessed type char var_C[4]; //----- (005C5270) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -384225,7 +383890,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -384234,7 +383899,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNonCombatDmgRespOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNonCombatDmgRespOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -384249,7 +383914,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5C5300: variable 'v5' is possibly undefined -// 5C5270: using guessed type char var_C[4]; //----- (005C5340) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -384338,7 +384002,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -384350,7 +384014,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5C5560: using guessed type char var_C[4]; //----- (005C55F0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -384380,7 +384043,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -384390,7 +384053,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cNonCombatDmgRespOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5C5650: using guessed type char var_8[4]; //----- (005C56E0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -384664,7 +384326,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -384692,7 +384354,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5C5D7C: variable 'v4' is possibly undefined -// 5C5CE0: using guessed type char var_10[4]; //----- (005C5DE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -385089,7 +384750,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 9826A0: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 9826B0: using guessed type void *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2; +// 9826B0: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2; //----- (005C6980) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -385103,7 +384764,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 9826A0: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 9826B0: using guessed type void *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2; +// 9826B0: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIConversationProperty___1_IID_IAIConversationProperty__3U_GUID__BPAVcAIConversationDesc__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIConversationDesc________6B__cUnknownProperty_UIAIConversationProperty___1_IID_IAIConver0ddab4d2; //----- (005C69F0) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -385464,7 +385125,7 @@ sDatum *__stdcall cHashPropertyStore>::Creat sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -385478,7 +385139,6 @@ sDatum *__stdcall cHashPropertyStore>::Creat result->value = val.value; return result; } -// 5C7120: using guessed type char var_8[4]; //----- (005C71D0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -385518,7 +385178,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -385536,7 +385196,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -385544,7 +385204,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5C7280: using guessed type char var_C[4]; //----- (005C7360) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -385555,7 +385214,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -385564,7 +385223,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -385579,7 +385238,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5C73F0: variable 'v5' is possibly undefined -// 5C7360: using guessed type char var_C[4]; //----- (005C7430) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -385669,7 +385327,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -385684,7 +385342,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5C7650: using guessed type char var_C[4]; //----- (005C76E0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -385715,7 +385372,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -385728,7 +385385,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 5C7740: using guessed type char var_8[4]; //----- (005C77D0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -385988,7 +385644,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -386016,7 +385672,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5C7E52: variable 'v4' is possibly undefined -// 5C7DB0: using guessed type char var_10[4]; //----- (005C7EB0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -386288,82 +385943,80 @@ void __cdecl AIInitCoreProps() cAIAlertnessProperty *v36; // [esp+5Ch] [ebp-48h] cAIEfficiencyProperty *v37; // [esp+60h] [ebp-44h] cAIProperty *v38; // [esp+64h] [ebp-40h] - IUnknown *v39; // [esp+68h] [ebp-3Ch] - IUnknown *v40; // [esp+6Ch] [ebp-38h] - IUnknown *v41; // [esp+70h] [ebp-34h] - IUnknown *v42; // [esp+74h] [ebp-30h] - IUnknown *v43; // [esp+78h] [ebp-2Ch] - IUnknown *v44; // [esp+7Ch] [ebp-28h] - IUnknown *v45; // [esp+80h] [ebp-24h] - IUnknown *v46; // [esp+84h] [ebp-20h] - IUnknown *v47; // [esp+88h] [ebp-1Ch] - IUnknown *v48; // [esp+8Ch] [ebp-18h] - IUnknown *v49; // [esp+90h] [ebp-14h] - IUnknown *v50; // [esp+94h] [ebp-10h] - IUnknown *v51; // [esp+98h] [ebp-Ch] - IUnknown *Aggregated; // [esp+9Ch] [ebp-8h] + IStructDescTools *v39; // [esp+68h] [ebp-3Ch] + IStructDescTools *v40; // [esp+6Ch] [ebp-38h] + IStructDescTools *v41; // [esp+70h] [ebp-34h] + IStructDescTools *v42; // [esp+74h] [ebp-30h] + IStructDescTools *v43; // [esp+78h] [ebp-2Ch] + IStructDescTools *v44; // [esp+7Ch] [ebp-28h] + IStructDescTools *v45; // [esp+80h] [ebp-24h] + IStructDescTools *v46; // [esp+84h] [ebp-20h] + IStructDescTools *v47; // [esp+88h] [ebp-1Ch] + IStructDescTools *v48; // [esp+8Ch] [ebp-18h] + IStructDescTools *v49; // [esp+90h] [ebp-14h] + IStructDescTools *v50; // [esp+94h] [ebp-10h] + IStructDescTools *v51; // [esp+98h] [ebp-Ch] + IStructDescTools *Aggregated; // [esp+9Ch] [ebp-8h] IStructDescTools *tools; // [esp+A0h] [ebp-4h] tools = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); tools->Register(tools, &g_AIPropStructDesc); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_AIEfficiencyStructDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_AIEfficiencyStructDesc); if ( Aggregated ) Aggregated->Release(Aggregated); - v51 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v51->__vftable[5].QueryInterface)(v51, &g_AIAlertnessStructDesc); + v51 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v51->Register(v51, &g_AIAlertnessStructDesc); if ( v51 ) v51->Release(v51); - v50 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v50->__vftable[5].QueryInterface)(v50, &g_AIFrustratedStructDesc); + v50 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v50->Register(v50, &g_AIFrustratedStructDesc); if ( v50 ) v50->Release(v50); - v49 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v49->__vftable[5].QueryInterface)(v49, &g_AIAlertCapStructDesc); + v49 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v49->Register(v49, &g_AIAlertCapStructDesc); if ( v49 ) v49->Release(v49); - v48 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v48->__vftable[5].QueryInterface)(v48, &g_AIVisibilityStructDesc); + v48 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v48->Register(v48, &g_AIVisibilityStructDesc); if ( v48 ) v48->Release(v48); - v47 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v47->__vftable[5].QueryInterface)(v47, &g_AIModeStructDesc); + v47 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v47->Register(v47, &g_AIModeStructDesc); if ( v47 ) v47->Release(v47); - v46 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v46->__vftable[5].QueryInterface)(v46, &g_AITeamStructDesc); + v46 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v46->Register(v46, &g_AITeamStructDesc); if ( v46 ) v46->Release(v46); - v45 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v45->__vftable[5].QueryInterface)(v45, &g_AIVisionJointStructDesc); + v45 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v45->Register(v45, &g_AIVisionJointStructDesc); if ( v45 ) v45->Release(v45); - v44 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v44->__vftable[5].QueryInterface)(v44, &g_AIVisionDescStructDesc); + v44 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v44->Register(v44, &g_AIVisionDescStructDesc); if ( v44 ) v44->Release(v44); - v43 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v43->__vftable[5].QueryInterface)(v43, &g_AIVisibilityModStructDesc); + v43 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v43->Register(v43, &g_AIVisibilityModStructDesc); if ( v43 ) v43->Release(v43); - v42 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v42->__vftable[5].QueryInterface)(v42, &g_AIVisCtrlStructDesc); + v42 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v42->Register(v42, &g_AIVisCtrlStructDesc); if ( v42 ) v42->Release(v42); - v41 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v41->__vftable[5].QueryInterface)(v41, &g_AIAwareCapStructDesc); + v41 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v41->Register(v41, &g_AIAwareCapStructDesc); if ( v41 ) v41->Release(v41); - v40 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v40->__vftable[5].QueryInterface)(v40, &g_AIAlertSenseMultsStructDesc); + v40 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v40->Register(v40, &g_AIAlertSenseMultsStructDesc); if ( v40 ) v40->Release(v40); - v39 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v39->__vftable[5].QueryInterface)(v39, &g_AIAwareDelayStructDesc); + v39 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v39->Register(v39, &g_AIAwareDelayStructDesc); if ( v39 ) v39->Release(v39); g_pAINoGrowOBBProperty = j__CreateBoolProperty(&g_AINoGrowOBBPropertyDesc, 1u); @@ -386664,7 +386317,7 @@ IStructEditor *__cdecl NewVisionDescDialog(char *data) int i; // [esp+48h] [ebp-68h] int choice; // [esp+4Ch] [ebp-64h] sStructEditorDesc stepDesc; // [esp+50h] [ebp-60h] BYREF - char buf[54]; // [esp+74h] [ebp-3Ch] BYREF + char buf[56]; // [esp+74h] [ebp-3Ch] BYREF int result; // [esp+ACh] [ebp-4h] responseMenu = (char **)f_malloc_db(0x30u, aRPrjThief2Skup_1741, 1415); @@ -390340,7 +389993,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 984458: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 984468: using guessed type void *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab; +// 984468: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab; //----- (005CE8F0) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -390354,7 +390007,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 984458: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 984468: using guessed type void *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab; +// 984468: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIAlertSenseMultsProperty___1_IID_IAIAlertSenseMultsProperty__3U_GUID__BPAUsAIAlertSenseMults__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIAlertSenseMults________6B__cUnknownProperty_UIAIAlertSenseMultsProperty___1_IID_IAa25a46ab; //----- (005CE960) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -391044,7 +390697,7 @@ void __thiscall cSpecificProperty::SetStore(this, &this->mStore); } // 984868: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 984878: using guessed type void *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8; +// 984878: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8; //----- (005CF8B0) -------------------------------------------------------- void __thiscall cSpecificProperty>>::~cSpecificProperty>>( @@ -391058,7 +390711,7 @@ void __thiscall cSpecificProperty::~cProperty(this); } // 984868: using guessed type void *cSpecificProperty>>::`vftable'{for `cStoredProperty'}; -// 984878: using guessed type void *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8; +// 984878: using guessed type _UNKNOWN *___7__cSpecificProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3U_GUID__BPAUsAIVisibilityControl__V__cHashPropertyStore_V__cNoZeroDataOps_VcAIVisibilityControl________6B__cUnknownProperty_UIAIVisCtrlProperty___1_IID_IAIVisCtrlProperty__3Ucda639e8; //----- (005CF920) -------------------------------------------------------- int __stdcall cSpecificProperty>>::Get( @@ -391771,7 +391424,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -391785,7 +391438,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D0830: using guessed type char var_8[4]; //----- (005D08E0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -391825,7 +391477,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -391840,7 +391492,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -391848,7 +391500,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D0990: using guessed type char var_C[4]; //----- (005D0A70) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -391859,7 +391510,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -391868,7 +391519,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -391883,7 +391534,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D0B00: variable 'v5' is possibly undefined -// 5D0A70: using guessed type char var_C[4]; //----- (005D0B40) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset(cHashPropertyStore > *this) @@ -391972,7 +391622,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -391984,7 +391634,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D0D60: using guessed type char var_C[4]; //----- (005D0DF0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion(cPropertyStore > *this) @@ -392014,7 +391663,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -392024,7 +391673,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D0E50: using guessed type char var_8[4]; //----- (005D0EE0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -392115,7 +391763,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -392129,7 +391777,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D1080: using guessed type char var_8[4]; //----- (005D1130) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -392169,7 +391816,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -392187,7 +391834,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -392195,7 +391842,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D11E0: using guessed type char var_C[4]; //----- (005D12C0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -392206,7 +391852,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -392215,7 +391861,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -392230,7 +391876,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D1350: variable 'v5' is possibly undefined -// 5D12C0: using guessed type char var_C[4]; //----- (005D1390) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -392320,7 +391965,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -392332,7 +391977,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D15B0: using guessed type char var_C[4]; //----- (005D1640) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -392363,7 +392007,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -392373,7 +392017,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D16A0: using guessed type char var_8[4]; //----- (005D1730) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -392464,7 +392107,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -392478,7 +392121,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D18D0: using guessed type char var_8[4]; //----- (005D1980) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -392518,7 +392160,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -392536,7 +392178,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -392544,7 +392186,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D1A30: using guessed type char var_C[4]; //----- (005D1B10) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -392555,7 +392196,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -392564,7 +392205,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -392579,7 +392220,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D1BA0: variable 'v5' is possibly undefined -// 5D1B10: using guessed type char var_C[4]; //----- (005D1BE0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -392669,7 +392309,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -392681,7 +392321,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D1E00: using guessed type char var_C[4]; //----- (005D1E90) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -392712,7 +392351,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -392722,7 +392361,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D1EF0: using guessed type char var_8[4]; //----- (005D1F80) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -392813,7 +392451,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -392827,7 +392465,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D2120: using guessed type char var_8[4]; //----- (005D21D0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -392867,7 +392504,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -392885,7 +392522,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -392893,7 +392530,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D2280: using guessed type char var_C[4]; //----- (005D2360) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -392904,7 +392540,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -392913,7 +392549,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -392928,7 +392564,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D23F0: variable 'v5' is possibly undefined -// 5D2360: using guessed type char var_C[4]; //----- (005D2430) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -393018,7 +392653,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393030,7 +392665,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D2650: using guessed type char var_C[4]; //----- (005D26E0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -393061,7 +392695,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -393071,7 +392705,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D2740: using guessed type char var_8[4]; //----- (005D27D0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -393162,7 +392795,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -393176,7 +392809,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D2970: using guessed type char var_8[4]; //----- (005D2A20) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -393216,7 +392848,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393234,7 +392866,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -393242,7 +392874,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D2AD0: using guessed type char var_C[4]; //----- (005D2BB0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -393253,7 +392884,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -393262,7 +392893,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -393277,7 +392908,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D2C40: variable 'v5' is possibly undefined -// 5D2BB0: using guessed type char var_C[4]; //----- (005D2C80) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -393367,7 +392997,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393379,7 +393009,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D2EA0: using guessed type char var_C[4]; //----- (005D2F30) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -393410,7 +393039,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -393420,7 +393049,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D2F90: using guessed type char var_8[4]; //----- (005D3020) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -393511,7 +393139,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -393525,7 +393153,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D31C0: using guessed type char var_8[4]; //----- (005D3270) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -393565,7 +393192,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393583,7 +393210,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -393591,7 +393218,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D3320: using guessed type char var_C[4]; //----- (005D3400) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -393602,7 +393228,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -393611,7 +393237,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -393626,7 +393252,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D3490: variable 'v5' is possibly undefined -// 5D3400: using guessed type char var_C[4]; //----- (005D34D0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -393716,7 +393341,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393728,7 +393353,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D36F0: using guessed type char var_C[4]; //----- (005D3780) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -393759,7 +393383,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -393769,7 +393393,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D37E0: using guessed type char var_8[4]; //----- (005D3870) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -393860,7 +393483,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -393874,7 +393497,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D3A10: using guessed type char var_8[4]; //----- (005D3AC0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -393914,7 +393536,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -393932,7 +393554,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -393940,7 +393562,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D3B70: using guessed type char var_C[4]; //----- (005D3C50) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -393951,7 +393572,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -393960,7 +393581,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -393975,7 +393596,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D3CE0: variable 'v5' is possibly undefined -// 5D3C50: using guessed type char var_C[4]; //----- (005D3D20) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -394065,7 +393685,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394077,7 +393697,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D3F40: using guessed type char var_C[4]; //----- (005D3FD0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -394108,7 +393727,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -394118,7 +393737,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D4030: using guessed type char var_8[4]; //----- (005D40C0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -394209,7 +393827,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -394223,7 +393841,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5D4260: using guessed type char var_8[4]; //----- (005D4310) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -394253,7 +393870,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394268,7 +393885,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIModeDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -394276,7 +393893,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 5D43C0: using guessed type char var_C[4]; //----- (005D44A0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -394287,7 +393903,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -394296,7 +393912,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIModeDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIModeDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -394311,7 +393927,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5D4530: variable 'v5' is possibly undefined -// 5D44A0: using guessed type char var_C[4]; //----- (005D4570) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -394397,7 +394012,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394409,7 +394024,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D4790: using guessed type char var_C[4]; //----- (005D4820) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -394433,7 +394047,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -394443,7 +394057,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D4880: using guessed type char var_8[4]; //----- (005D4910) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -394534,7 +394147,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -394548,7 +394161,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D4AB0: using guessed type char var_8[4]; //----- (005D4B60) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -394588,7 +394200,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394606,7 +394218,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -394614,7 +394226,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D4C10: using guessed type char var_C[4]; //----- (005D4CF0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -394625,7 +394236,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -394634,7 +394245,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -394649,7 +394260,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D4D80: variable 'v5' is possibly undefined -// 5D4CF0: using guessed type char var_C[4]; //----- (005D4DC0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -394739,7 +394349,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394751,7 +394361,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5D4FE0: using guessed type char var_C[4]; //----- (005D5070) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -394782,7 +394391,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -394792,7 +394401,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5D50D0: using guessed type char var_8[4]; //----- (005D5160) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -394883,7 +394491,7 @@ sDatum *__stdcall cHashPropertyStore>::Create sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -394897,7 +394505,6 @@ sDatum *__stdcall cHashPropertyStore>::Create result->value = val.value; return result; } -// 5D5300: using guessed type char var_8[4]; //----- (005D53B0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -394937,7 +394544,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -394955,7 +394562,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -394963,7 +394570,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D5460: using guessed type char var_C[4]; //----- (005D5540) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -394974,7 +394580,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -394983,7 +394589,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -394998,7 +394604,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D55D0: variable 'v5' is possibly undefined -// 5D5540: using guessed type char var_C[4]; //----- (005D5610) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -395088,7 +394693,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -395103,7 +394708,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5D5830: using guessed type char var_C[4]; //----- (005D58C0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -395134,7 +394738,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -395147,7 +394751,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 5D5920: using guessed type char var_8[4]; //----- (005D59B0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -395238,7 +394841,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -395252,7 +394855,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D5B50: using guessed type char var_8[4]; //----- (005D5C00) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -395292,7 +394894,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -395310,7 +394912,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -395318,7 +394920,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D5CB0: using guessed type char var_C[4]; //----- (005D5D90) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -395329,7 +394930,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -395338,7 +394939,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -395353,7 +394954,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D5E20: variable 'v5' is possibly undefined -// 5D5D90: using guessed type char var_C[4]; //----- (005D5E60) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -395443,7 +395043,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -395458,7 +395058,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5D6080: using guessed type char var_C[4]; //----- (005D6110) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -395489,7 +395088,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -395502,7 +395101,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 5D6170: using guessed type char var_8[4]; //----- (005D6200) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -395593,7 +395191,7 @@ sDatum *__stdcall cHashPropertyStore>::Crea sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -395607,7 +395205,6 @@ sDatum *__stdcall cHashPropertyStore>::Crea result->value = val.value; return result; } -// 5D63A0: using guessed type char var_8[4]; //----- (005D6450) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -395647,7 +395244,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -395665,7 +395262,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -395673,7 +395270,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D6500: using guessed type char var_C[4]; //----- (005D65E0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -395684,7 +395280,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -395693,7 +395289,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -395708,7 +395304,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy return result; } // 5D6670: variable 'v5' is possibly undefined -// 5D65E0: using guessed type char var_C[4]; //----- (005D66B0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -395798,7 +395393,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -395813,7 +395408,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5D68D0: using guessed type char var_C[4]; //----- (005D6960) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -395844,7 +395438,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -395857,7 +395451,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 5D69C0: using guessed type char var_8[4]; //----- (005D6A50) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -395948,7 +395541,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -395962,7 +395555,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5D6BF0: using guessed type char var_8[4]; //----- (005D6CA0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -396002,7 +395594,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -396020,7 +395612,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -396028,7 +395620,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5D6D50: using guessed type char var_C[4]; //----- (005D6E30) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -396039,7 +395630,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -396048,7 +395639,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -396063,7 +395654,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5D6EC0: variable 'v5' is possibly undefined -// 5D6E30: using guessed type char var_C[4]; //----- (005D6F00) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -396153,7 +395743,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -396168,7 +395758,6 @@ int __stdcall cPropertyStore>::ReadObj( dat.value); return retval; } -// 5D7120: using guessed type char var_C[4]; //----- (005D71B0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -396199,7 +395788,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -396212,7 +395801,6 @@ int __stdcall cPropertyStore>::GetCopy( dat.value); return 1; } -// 5D7210: using guessed type char var_8[4]; //----- (005D72A0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -397336,7 +396924,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -397364,7 +396952,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5D8F9C: variable 'v4' is possibly undefined -// 5D8F00: using guessed type char var_10[4]; //----- (005D9000) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -397514,7 +397101,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -397542,7 +397129,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5D93FC: variable 'v4' is possibly undefined -// 5D9360: using guessed type char var_10[4]; //----- (005D9460) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -397695,7 +397281,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -397723,7 +397309,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5D983C: variable 'v4' is possibly undefined -// 5D97A0: using guessed type char var_10[4]; //----- (005D98A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -397878,7 +397463,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -397906,7 +397491,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5D9C6C: variable 'v4' is possibly undefined -// 5D9BD0: using guessed type char var_10[4]; //----- (005D9CD0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -398059,7 +397643,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398087,7 +397671,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DA0AC: variable 'v4' is possibly undefined -// 5DA010: using guessed type char var_10[4]; //----- (005DA110) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -398222,7 +397805,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398250,7 +397833,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DA4CC: variable 'v4' is possibly undefined -// 5DA430: using guessed type char var_10[4]; //----- (005DA530) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -398385,7 +397967,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398413,7 +397995,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DA8EC: variable 'v4' is possibly undefined -// 5DA850: using guessed type char var_10[4]; //----- (005DA950) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -398597,7 +398178,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398625,7 +398206,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DAE82: variable 'v4' is possibly undefined -// 5DADE0: using guessed type char var_10[4]; //----- (005DAEE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -398779,7 +398359,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398807,7 +398387,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DB2DC: variable 'v4' is possibly undefined -// 5DB240: using guessed type char var_10[4]; //----- (005DB340) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -398961,7 +398540,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -398989,7 +398568,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DB73C: variable 'v4' is possibly undefined -// 5DB6A0: using guessed type char var_10[4]; //----- (005DB7A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -399148,7 +398726,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -399176,7 +398754,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DBB9C: variable 'v4' is possibly undefined -// 5DBB00: using guessed type char var_10[4]; //----- (005DBC00) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -399341,7 +398918,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -399369,7 +398946,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5DC03C: variable 'v4' is possibly undefined -// 5DBFA0: using guessed type char var_10[4]; //----- (005DC0A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -401522,7 +401098,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -401536,7 +401112,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5DEFD0: using guessed type char var_8[4]; //----- (005DF080) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -401566,7 +401141,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore //----- (005DF130) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -401581,7 +401156,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore } else { - setval.value = *(void **)((int (__stdcall *)(cDeviceOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cDeviceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -401589,7 +401164,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5DF130: using guessed type char var_C[4]; //----- (005DF210) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -401600,7 +401174,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -401609,7 +401183,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cDeviceOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cDeviceOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -401624,7 +401198,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5DF2A0: variable 'v5' is possibly undefined -// 5DF210: using guessed type char var_C[4]; //----- (005DF2E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -401705,7 +401278,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -401717,7 +401290,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5DF500: using guessed type char var_C[4]; //----- (005DF590) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -401741,7 +401313,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (005DF5F0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -401751,7 +401323,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cDeviceOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5DF5F0: using guessed type char var_8[4]; //----- (005DF680) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -401838,7 +401409,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -401852,7 +401423,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5DF820: using guessed type char var_8[4]; //----- (005DF8D0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -401882,7 +401452,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore //----- (005DF980) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -401897,7 +401467,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore } else { - setval.value = *(void **)((int (__stdcall *)(cTurretOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cTurretOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -401905,7 +401475,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5DF980: using guessed type char var_C[4]; //----- (005DFA60) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -401916,7 +401485,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -401925,7 +401494,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cTurretOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cTurretOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -401940,7 +401509,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5DFAF0: variable 'v5' is possibly undefined -// 5DFA60: using guessed type char var_C[4]; //----- (005DFB30) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -402021,7 +401589,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -402033,7 +401601,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5DFD50: using guessed type char var_C[4]; //----- (005DFDE0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -402057,7 +401624,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (005DFE40) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -402067,7 +401634,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cTurretOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5DFE40: using guessed type char var_8[4]; //----- (005DFED0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -402154,7 +401720,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -402168,7 +401734,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5E0070: using guessed type char var_8[4]; //----- (005E0120) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -402198,7 +401763,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore //----- (005E01D0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -402213,7 +401778,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore } else { - setval.value = *(void **)((int (__stdcall *)(cCameraOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cCameraOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -402221,7 +401786,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5E01D0: using guessed type char var_C[4]; //----- (005E02B0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -402232,7 +401796,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -402241,7 +401805,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cCameraOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cCameraOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -402256,7 +401820,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5E0340: variable 'v5' is possibly undefined -// 5E02B0: using guessed type char var_C[4]; //----- (005E0380) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -402337,7 +401900,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -402349,7 +401912,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5E05A0: using guessed type char var_C[4]; //----- (005E0630) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -402373,7 +401935,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *thi //----- (005E0690) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -402383,7 +401945,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore *th ((void (__stdcall *)(cCameraOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5E0690: using guessed type char var_8[4]; //----- (005E0720) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -402645,7 +402206,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -402673,7 +402234,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5E0E0C: variable 'v4' is possibly undefined -// 5E0D70: using guessed type char var_10[4]; //----- (005E0E70) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -402873,7 +402433,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -402901,7 +402461,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5E132C: variable 'v4' is possibly undefined -// 5E1290: using guessed type char var_10[4]; //----- (005E1390) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -403099,7 +402658,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -403127,7 +402686,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5E182C: variable 'v4' is possibly undefined -// 5E1790: using guessed type char var_10[4]; //----- (005E1890) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -404000,7 +403558,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -404014,7 +403572,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5E2D90: using guessed type char var_8[4]; //----- (005E2E40) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -404050,7 +403607,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -404065,7 +403622,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRatingDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRatingDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -404073,7 +403630,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5E2EF0: using guessed type char var_C[4]; //----- (005E2FD0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -404084,7 +403640,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -404093,7 +403649,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRatingDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRatingDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -404108,7 +403664,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5E3060: variable 'v5' is possibly undefined -// 5E2FD0: using guessed type char var_C[4]; //----- (005E30A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -404197,7 +403752,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -404209,7 +403764,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5E32C0: using guessed type char var_C[4]; //----- (005E3350) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -404233,7 +403787,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -404243,7 +403797,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5E33B0: using guessed type char var_8[4]; //----- (005E3440) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -407678,7 +407231,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -407688,7 +407241,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 5E84C0: using guessed type char var_10[4]; //----- (005E8530) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -407728,7 +407280,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -407741,13 +407293,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cVantagePtOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 5E8620: using guessed type char var_10[4]; //----- (005E86D0) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -407759,7 +407310,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -407779,7 +407330,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cVantagePtOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cVantagePtOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -407795,7 +407346,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 5E86D0: using guessed type char var_18[4]; //----- (005E87E0) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -407888,7 +407438,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -407900,7 +407450,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5E89C0: using guessed type char var_C[4]; //----- (005E8A50) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -407924,7 +407473,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -407934,7 +407483,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5E8AB0: using guessed type char var_8[4]; //----- (005E8B40) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -408021,7 +407569,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -408031,7 +407579,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 5E8CE0: using guessed type char var_10[4]; //----- (005E8D50) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -408071,7 +407618,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -408084,13 +407631,12 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cCoverPtOps *, _BYTE *, void *))this->mOps.CopyNew)(&this->mOps, v6, val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 5E8E40: using guessed type char var_10[4]; //----- (005E8EF0) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -408102,7 +407648,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -408122,7 +407668,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cCoverPtOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cCoverPtOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -408138,7 +407684,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 5E8EF0: using guessed type char var_18[4]; //----- (005E9000) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -408231,7 +407776,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -408243,7 +407788,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5E91E0: using guessed type char var_C[4]; //----- (005E9270) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -408267,7 +407811,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (005E92D0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -408277,7 +407821,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cCoverPtOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5E92D0: using guessed type char var_8[4]; //----- (005E9360) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -408365,7 +407908,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -408375,7 +407918,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 5E9500: using guessed type char var_10[4]; //----- (005E9570) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -408415,7 +407957,7 @@ int __stdcall cListPropertyStore::Set(cListPropertyStore *node; // [esp+Ch] [ebp-4h] @@ -408428,13 +407970,15 @@ int __stdcall cListPropertyStore::Set(cListPropertyStoremOps.CopyNew)(&this->mOps, v6, val.value); + v5 = (sDatum *)((int (__stdcall *)(cAngleLimitOps *, _BYTE *, void *))this->mOps.CopyNew)( + &this->mOps, + v6, + val.value); sObjDatumPair::sObjDatumPair(&newpair, obj, (sDatum)v5->value); cSimpleDList::Prepend(&this->mList, &newpair); return 0; } } -// 5E9660: using guessed type char var_10[4]; //----- (005E9710) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -408446,7 +407990,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -408466,7 +408010,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cAngleLimitOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cAngleLimitOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -408482,7 +408026,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 5E9710: using guessed type char var_18[4]; //----- (005E9820) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -408578,7 +408121,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -408590,7 +408133,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5E9A00: using guessed type char var_C[4]; //----- (005E9A90) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -408614,7 +408156,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -408624,7 +408166,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5E9AF0: using guessed type char var_8[4]; //----- (005E9B80) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -408715,7 +408256,7 @@ sDatum *__stdcall cListPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-10h] BYREF sDatum dat; // [esp+4h] [ebp-Ch] sObjDatumPair pair; // [esp+8h] [ebp-8h] BYREF @@ -408725,7 +408266,6 @@ sDatum *__stdcall cListPropertyStore::Create( result->value = dat.value; return result; } -// 5E9D20: using guessed type char var_10[4]; //----- (005E9D90) -------------------------------------------------------- int __stdcall cListPropertyStore::Delete(cListPropertyStore *this, int obj) @@ -408771,7 +408311,7 @@ int __stdcall cListPropertyStore::Set( { sObjDatumPair *v3; // eax sDatum *v5; // eax - char v6[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v6[4]; // [esp+0h] [ebp-10h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-Ch] BYREF cSimpleDListNode *node; // [esp+Ch] [ebp-4h] @@ -408784,7 +408324,7 @@ int __stdcall cListPropertyStore::Set( } else { - v5 = (sDatum *)((int (__stdcall *)(cAIRangedCombatOps *, char *, void *))this->mOps.CopyNew)( + v5 = (sDatum *)((int (__stdcall *)(cAIRangedCombatOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v6, val.value); @@ -408793,7 +408333,6 @@ int __stdcall cListPropertyStore::Set( return 0; } } -// 5E9E80: using guessed type char var_10[4]; //----- (005E9F30) -------------------------------------------------------- sDatum *__stdcall cListPropertyStore::Copy( @@ -408805,7 +408344,7 @@ sDatum *__stdcall cListPropertyStore::Copy( sObjDatumPair *v5; // eax sDatum *v6; // eax void *value; // [esp-4h] [ebp-1Ch] - char v8[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v8[4]; // [esp+0h] [ebp-18h] BYREF sObjDatumPair newpair; // [esp+4h] [ebp-14h] BYREF cSimpleDListNode *srcnode; // [esp+Ch] [ebp-Ch] sObjDatumPair *srcpair; // [esp+10h] [ebp-8h] @@ -408825,7 +408364,7 @@ sDatum *__stdcall cListPropertyStore::Copy( } else { - v6 = (sDatum *)((int (__stdcall *)(cAIRangedCombatOps *, char *, void *))this->mOps.CopyNew)( + v6 = (sDatum *)((int (__stdcall *)(cAIRangedCombatOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v8, srcpair->val.value); @@ -408841,7 +408380,6 @@ sDatum *__stdcall cListPropertyStore::Copy( return result; } } -// 5E9F30: using guessed type char var_18[4]; //----- (005EA040) -------------------------------------------------------- int __stdcall cListPropertyStore::Reset(cListPropertyStore *this) @@ -408940,7 +408478,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -408952,7 +408490,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5EA220: using guessed type char var_C[4]; //----- (005EA2B0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -408979,7 +408516,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -408989,7 +408526,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cAIRangedCombatOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5EA310: using guessed type char var_8[4]; //----- (005EA3A0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -409080,7 +408616,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -409094,7 +408630,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5EA540: using guessed type char var_8[4]; //----- (005EA5F0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -409130,7 +408665,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -409145,7 +408680,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRangedRangesOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRangedRangesOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -409153,7 +408688,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5EA6A0: using guessed type char var_C[4]; //----- (005EA780) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -409164,7 +408698,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -409173,7 +408707,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRangedRangesOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRangedRangesOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -409188,7 +408722,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5EA810: variable 'v5' is possibly undefined -// 5EA780: using guessed type char var_C[4]; //----- (005EA850) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -409277,7 +408810,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -409289,7 +408822,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5EAA70: using guessed type char var_C[4]; //----- (005EAB00) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -409316,7 +408848,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -409326,7 +408858,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cAIRangedRangesOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5EAB60: using guessed type char var_8[4]; //----- (005EABF0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -409417,7 +408948,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -409431,7 +408962,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 5EAD90: using guessed type char var_8[4]; //----- (005EAE40) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -409467,7 +408997,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -409482,7 +409012,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIRangedWoundOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIRangedWoundOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -409490,7 +409020,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5EAEF0: using guessed type char var_C[4]; //----- (005EAFD0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -409501,7 +409030,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -409510,7 +409039,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIRangedWoundOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIRangedWoundOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -409525,7 +409054,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 5EB060: variable 'v5' is possibly undefined -// 5EAFD0: using guessed type char var_C[4]; //----- (005EB0A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -409614,7 +409142,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -409626,7 +409154,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5EB2C0: using guessed type char var_C[4]; //----- (005EB350) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -409650,7 +409177,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -409660,7 +409187,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5EB3B0: using guessed type char var_8[4]; //----- (005EB440) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -410046,7 +409572,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -410074,7 +409600,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5EBE6C: variable 'v4' is possibly undefined -// 5EBDD0: using guessed type char var_10[4]; //----- (005EBED0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -410271,7 +409796,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -410299,7 +409824,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5EC38C: variable 'v4' is possibly undefined -// 5EC2F0: using guessed type char var_10[4]; //----- (005EC3F0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -410478,7 +410002,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -410506,7 +410030,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5EC81C: variable 'v4' is possibly undefined -// 5EC780: using guessed type char var_10[4]; //----- (005EC880) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -410700,7 +410223,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -410728,7 +410251,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5ECCFC: variable 'v4' is possibly undefined -// 5ECC60: using guessed type char var_10[4]; //----- (005ECD60) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -410930,7 +410452,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -410958,7 +410480,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5ED21C: variable 'v4' is possibly undefined -// 5ED180: using guessed type char var_10[4]; //----- (005ED280) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -411158,7 +410679,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -411186,7 +410707,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5ED71C: variable 'v4' is possibly undefined -// 5ED680: using guessed type char var_10[4]; //----- (005ED780) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -411827,7 +411347,7 @@ void __thiscall cAIShootsThroughProp::RebuildConcrete( uPropListenerValue val, int donor) { - int objindex; // [esp+4h] [ebp-Ch] + unsigned int objindex; // [esp+4h] [ebp-Ch] int shootsthrough; // [esp+8h] [ebp-8h] shootsthrough = val.intval; @@ -412424,7 +411944,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -412438,7 +411958,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 5EF5E0: using guessed type char var_8[4]; //----- (005EF690) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -412478,7 +411997,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -412496,7 +412015,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -412504,7 +412023,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 5EF740: using guessed type char var_C[4]; //----- (005EF820) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -412515,7 +412033,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -412524,7 +412042,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -412539,7 +412057,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 5EF8B0: variable 'v5' is possibly undefined -// 5EF820: using guessed type char var_C[4]; //----- (005EF8F0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -412629,7 +412146,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -412641,7 +412158,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 5EFB10: using guessed type char var_C[4]; //----- (005EFBA0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -412672,7 +412188,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -412682,7 +412198,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 5EFC00: using guessed type char var_8[4]; //----- (005EFC90) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -412858,8 +412373,8 @@ sDatum *__stdcall cClassDataOps::New(cClassDataOps * resulta = (sAISoundType *)j__new(0x28u, aRPrjThief2Skup_31, 57); if ( (this->mFlags & 1) != 0 ) - memset(resulta, 0, sizeof(sAISoundType)); - sDatum::sDatum(result, resulta); + memset((void *)resulta, 0, sizeof(sAISoundType)); + sDatum::sDatum(result, (void *)resulta); return result; } @@ -412921,7 +412436,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -412949,7 +412464,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 5F02DC: variable 'v4' is possibly undefined -// 5F0240: using guessed type char var_10[4]; //----- (005F0340) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -413189,8 +412703,8 @@ void __cdecl _E23_2() //----- (005F086D) -------------------------------------------------------- void __cdecl AIInitSenses() { - IUnknown *v0; // [esp+0h] [ebp-Ch] - IUnknown *Aggregated; // [esp+4h] [ebp-8h] + IStructDescTools *v0; // [esp+0h] [ebp-Ch] + IStructDescTools *Aggregated; // [esp+4h] [ebp-8h] IStructDescTools *tools; // [esp+8h] [ebp-4h] g_AIDefVisCtrl.lowVisibility = 13; @@ -413209,14 +412723,12 @@ void __cdecl AIInitSenses() tools->Register(tools, &g_AIAcuitySetsStructDesc); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &g_AISoundTweaksStructDesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &g_AISoundTweaksStructDesc); if ( Aggregated ) Aggregated->Release(Aggregated); - v0 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v0->__vftable[5].QueryInterface)(v0, &g_AIHearStatStructDesc); + v0 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v0->Register(v0, &g_AIHearStatStructDesc); if ( v0 ) v0->Release(v0); g_pAIFreeKnowledgeProperty = j__CreateIntProperty(&g_AIFreeKnowledgePropertyDesc, 3u); @@ -413459,9 +412971,9 @@ void __stdcall cAISenses::OnSound(cAISenses *this, const sSoundInfo *pSoundInfo, const char *v13; // [esp-8h] [ebp-4Ch] int Distance; // [esp-4h] [ebp-48h] eAITeam v15; // [esp-4h] [ebp-48h] - int v16; // [esp+8h] [ebp-3Ch] + BOOL v16; // [esp+8h] [ebp-3Ch] int v17; // [esp+Ch] [ebp-38h] - int v18; // [esp+10h] [ebp-34h] + BOOL v18; // [esp+10h] [ebp-34h] cAnsiStr v19; // [esp+18h] [ebp-2Ch] BYREF cAnsiStr v20; // [esp+24h] [ebp-20h] BYREF int fTreatAsPos; // [esp+30h] [ebp-14h] @@ -413539,7 +413051,7 @@ void __stdcall cAISenses::OnSound(cAISenses *this, const sSoundInfo *pSoundInfo, p = (sAIQueuedSound *)j__new(0xC0u, aRPrjThief2Skup_1693, 820); LABEL_40: qmemcpy(p, pSoundInfo, 0x98u); - qmemcpy(&p->type, pType, sizeof(p->type)); + qmemcpy((void *)&p->type, pType, sizeof(p->type)); if ( fTreatAsPos ) this->m_pPositionSound = p; else @@ -413681,7 +413193,7 @@ void __stdcall cAISenses::OnFastObj(cAISenses *this, int firer, int projectile, float num2; // [esp+10h] [ebp-1Ch] float num1; // [esp+14h] [ebp-18h] const mxs_vector *pFirerLoc; // [esp+18h] [ebp-14h] - int we_care; // [esp+1Ch] [ebp-10h] + BOOL we_care; // [esp+1Ch] [ebp-10h] mxs_vector delta; // [esp+20h] [ebp-Ch] BYREF ID = cAIComponentBase::GetID(this); @@ -413689,7 +413201,7 @@ void __stdcall cAISenses::OnFastObj(cAISenses *this, int firer, int projectile, { pFirerLoc = GetObjLocation(firer); we_care = 0; - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); mx_sub_vec(&delta, Location, pFirerLoc); if ( j__mx_dot_vec(&delta, velocity) > 0.0 ) { @@ -413757,9 +413269,9 @@ int __stdcall cAISenses::Update(cAISenses *this) { if ( AIs[i] != this->m_pAI ) { - v2 = (cAIState *)AIs[i]->GetState(AIs[i]); + v2 = AIs[i]->GetState(AIs[i]); Location = cAIState::GetLocation(v2); - if ( cAIState::DistSq((cAIState *)this->m_pAIState, Location) < 2025.0 ) + if ( cAIState::DistSq(this->m_pAIState, Location) < 2025.0 ) { v4 = AIs[i]->GetObjID(AIs[i]); if ( j__ObjHasRefs(v4) ) @@ -413786,7 +413298,7 @@ int __stdcall cAISenses::Update(cAISenses *this) pQuery = 0; player_object = j__get_player_object(); ObjLocation = GetObjLocation(player_object); - if ( cAIState::DistSq((cAIState *)this->m_pAIState, ObjLocation) <= 1600.0 ) + if ( cAIState::DistSq(this->m_pAIState, ObjLocation) <= 1600.0 ) cAITimer::Reset(&this->m_Timer); else cAITimer::Delay(&this->m_Timer, 0x1F4u); @@ -413833,7 +413345,7 @@ int __thiscall cAISenses::GetAwarenessLink(cAISenses *this, int objId, sAIAwaren else { *ppAwareness = &awarenessBuf_0; - memset(&awarenessBuf_0, 0, sizeof(awarenessBuf_0)); + memset((void *)&awarenessBuf_0, 0, sizeof(awarenessBuf_0)); (*ppAwareness)->lastContact = 0x7FFFFFFF; if ( time > 50 ) (*ppAwareness)->updateTime = time - 50; @@ -413892,12 +413404,12 @@ int __stdcall cAISenses::Update(cAISenses *this, int objId, unsigned int flags) pAwareness->updateTime = time; visionPulse = kAIAL_Lowest; soundPulse = kAIAL_Lowest; - locAI = cAIState::GetLocation((cAIState *)this->m_pAIState); + locAI = cAIState::GetLocation(this->m_pAIState); cMxsVector::cMxsVector(&locObject); GetObjLocation(objId, &locObject); - if ( j__IsAPlayer(objId) && cAIState::GetMode((cAIState *)this->m_pAIState) < kAIM_Normal - || (v4 = cAIState::DiffZ((cAIState *)this->m_pAIState, &locObject), zDiff = v4, v4 >= 45.0) - || (v5 = cAIState::DistSq((cAIState *)this->m_pAIState, &locObject), args.distSq = v5, v5 >= 8100.0) ) + if ( j__IsAPlayer(objId) && cAIState::GetMode(this->m_pAIState) < kAIM_Normal + || (v4 = cAIState::DiffZ(this->m_pAIState, &locObject), zDiff = v4, v4 >= 45.0) + || (v5 = cAIState::DistSq(this->m_pAIState, &locObject), args.distSq = v5, v5 >= 8100.0) ) { pAwareness->flags &= 0xFFFFFFF0; } @@ -413905,7 +413417,7 @@ int __stdcall cAISenses::Update(cAISenses *this, int objId, unsigned int flags) { args.obj = objId; args.flags = flags; - args.fromLoc = *cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + args.fromLoc = *cAIState::GetPortalLocation(this->m_pAIState); args.pTargetLoc = (const Location *)j__ObjPosGet(objId); args.lookLoc = *args.pTargetLoc; ID = cAIComponentBase::GetID(this); @@ -414205,7 +413717,7 @@ int __thiscall cAISenses::GetVisibility( } visibilityToViewer = (double)cAISenses::CalculateLightRating(args->obj, pVisCtrl) * ((double)pCone->acuity / 100.0); } - v7 = cAIState::GetID((cAIState *)this->m_pAIState); + v7 = cAIState::GetID(this->m_pAIState); if ( g_pAIVisionTypeProperty->Get(g_pAIVisionTypeProperty, v7, &visionType) && (unsigned int)visionType <= 5 ) { v8 = AIGetProperty(g_pAIVisibilityModProperty, args->obj, &g_AIDefVisibilityMods); @@ -414320,8 +413832,8 @@ const sAIAwareness *__stdcall cAISenses::GetHighAwareness(cAISenses *this, char } else if ( pCurrent->lastContact <= pHighest->lastContact ) { - v12 = cAIState::DistSq((cAIState *)this->m_pAIState, &pCurrent->lastPos); - if ( cAIState::DistSq((cAIState *)this->m_pAIState, &pHighest->lastPos) > (double)v12 ) + v12 = cAIState::DistSq(this->m_pAIState, &pCurrent->lastPos); + if ( cAIState::DistSq(this->m_pAIState, &pHighest->lastPos) > (double)v12 ) pHighest = pCurrent; } else @@ -414393,9 +413905,7 @@ unsigned int __stdcall cAISenses::GetAllAwareness(cAISenses *this, cDynArrayobject = link.dest; v4 = pQuery->ID(pQuery); pCurrent->linkID = v4; - cDABase>::Append( - pResult, - (const sAIAwareness *const *)&pCurrent); + cDABase>::Append(pResult, &pCurrent); pQuery->Next(pQuery); } if ( pQuery ) @@ -414404,23 +413914,23 @@ unsigned int __stdcall cAISenses::GetAllAwareness(cAISenses *this, cDynArraySetData(g_pAIAwarenessLinks, linkId, pAwareness); + g_pAIAwarenessLinks->SetData(g_pAIAwarenessLinks, linkId, (void *)pAwareness); } else if ( pAwareness->level ) { ID = cAIComponentBase::GetID(this); - g_pAIAwarenessLinks->AddFull(g_pAIAwarenessLinks, ID, objId, pAwareness); + g_pAIAwarenessLinks->AddFull(g_pAIAwarenessLinks, ID, objId, (void *)pAwareness); } } //----- (005F2B90) -------------------------------------------------------- -void __thiscall cAISenses::TestForget(cAISenses *this, int linkId, sAIAwareness *pAwareness) +void __thiscall cAISenses::TestForget(cAISenses *this, int linkId, const sAIAwareness *pAwareness) { if ( sAIAwareness::TimeSinceContact(pAwareness) > 0x1D4C0 && (pAwareness->flags & 4) == 0 ) g_pAIAwarenessLinks->Remove(g_pAIAwarenessLinks, linkId); @@ -414795,9 +414305,7 @@ void __thiscall cAISenses::AwarenessDelay( v19 = g_pAIDefAwareDelay; ID = cAIComponentBase::GetID(this); pDelay = AIGetProperty(g_pAIAwareDelayProperty, ID, v19); - if ( (double)(pDelay->ignoreRange * pDelay->ignoreRange) <= cAIState::DistSq( - (cAIState *)this->m_pAIState, - pulseLoc) ) + if ( (double)(pDelay->ignoreRange * pDelay->ignoreRange) <= cAIState::DistSq(this->m_pAIState, pulseLoc) ) { if ( *pPulse == kAIAL_Moderate ) { @@ -414959,7 +414467,7 @@ const sAIVisionCone *__thiscall cAISenses::FindVisionCone(cAISenses *this, const const floatang *v7; // [esp-4h] [ebp-44h] int v8; // [esp-4h] [ebp-44h] floatang result; // [esp+4h] [ebp-3Ch] BYREF - char v11[4]; // [esp+8h] [ebp-38h] BYREF + _BYTE v11[4]; // [esp+8h] [ebp-38h] BYREF floatang v12; // [esp+Ch] [ebp-34h] BYREF float useAng; // [esp+10h] [ebp-30h] const sAIVisionCone *cones; // [esp+14h] [ebp-2Ch] @@ -414974,7 +414482,7 @@ const sAIVisionCone *__thiscall cAISenses::FindVisionCone(cAISenses *this, const eAIAwareLevel alertness; // [esp+38h] [ebp-8h] float zAng; // [esp+3Ch] [ebp-4h] - alertness = cAIState::GetAlertness((cAIState *)this->m_pAIState); + alertness = cAIState::GetAlertness(this->m_pAIState); distSq = (__int64)args->distSq; cones = args->pVisionDesc->cones; viewPos = &args->fromLoc.vec; @@ -415015,7 +414523,6 @@ const sAIVisionCone *__thiscall cAISenses::FindVisionCone(cAISenses *this, const return &cones[i]; } // 5F3984: variable 'v3' is possibly undefined -// 5F38DF: using guessed type char var_38[4]; //----- (005F3B1E) -------------------------------------------------------- floatang *__thiscall cAISenses::GetVisionFacing(cAISenses *this, floatang *result) @@ -415036,15 +414543,15 @@ floatang *__thiscall cAISenses::GetVisionFacing(cAISenses *this, floatang *resul int our_id; // [esp+6Ch] [ebp-8h] int visionJoint; // [esp+70h] [ebp-4h] - if ( !cAIState::IsCreature((cAIState *)this->m_pAIState) ) + if ( !cAIState::IsCreature(this->m_pAIState) ) goto LABEL_13; - our_id = cAIState::GetID((cAIState *)this->m_pAIState); + our_id = cAIState::GetID(this->m_pAIState); visionJoint = AIGetProperty(g_pAIVisionJointProperty, our_id, 0); if ( !visionJoint ) goto LABEL_13; if ( j__GetCreatureJointID(our_id, visionJoint) == -1 ) { - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); v7 = j__ObjEditName(ID); cAnsiStr::cAnsiStr(&v13, v7); v9 = cAnsiStr::operator char const *(v8); @@ -415063,7 +414570,7 @@ floatang *__thiscall cAISenses::GetVisionFacing(cAISenses *this, floatang *resul mprintf("ARGH! GetVisionFacing has %g %g %g for %s\n", head_mat.m0, head_mat.m1, head_mat.m2, v4); cAnsiStr::~cAnsiStr(&v14); LABEL_13: - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v12); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v12); floatang::floatang(result, FacingAng); return result; } @@ -415104,7 +414611,7 @@ int __stdcall cAISenses::Hears(cAISenses *this, const sSoundInfo *pSoundInfo, co const char *v8; // [esp-Ch] [ebp-14h] int Distance; // [esp-8h] [ebp-10h] int Volume; // [esp-4h] [ebp-Ch] - int hear_lvl; // [esp+4h] [ebp-4h] + eAIRating hear_lvl; // [esp+4h] [ebp-4h] ID = cAIComponentBase::GetID(this); hear_lvl = AIGetProperty(g_pAIHearingStatProp, ID, kAIRT_Avg); @@ -415131,7 +414638,7 @@ int __stdcall cAISenses::Hears(cAISenses *this, const sSoundInfo *pSoundInfo, co } //----- (005F3EA7) -------------------------------------------------------- -void __stdcall cAISenses::KeepFresh(cAISenses *this, int obj, signed int duration) +void __stdcall cAISenses::KeepFresh(cAISenses *this, int obj, eAITimerPeriod duration) { int ID; // eax unsigned int flags; // eax @@ -415145,7 +414652,7 @@ void __stdcall cAISenses::KeepFresh(cAISenses *this, int obj, signed int duratio { if ( duration ) { - cAITimer::Set(&this->m_FreshTimer, (eAITimerPeriod)duration); + cAITimer::Set(&this->m_FreshTimer, duration); } else { @@ -415176,8 +414683,8 @@ void __thiscall cAISenses::GetBestInWorld(cAISenses *this, const mxs_vector *ori unsigned int PathCell; // [esp-8h] [ebp-10h] unsigned int cell; // [esp+4h] [ebp-4h] - PathCell = cAIState::GetPathCell((cAIState *)this->m_pAIState); - Location = cAIState::GetLocation((cAIState *)this->m_pAIState); + PathCell = cAIState::GetPathCell(this->m_pAIState); + Location = cAIState::GetLocation(this->m_pAIState); cell = AILocateBestLocoCell(Location, PathCell, original); if ( !cell ) { @@ -415266,7 +414773,7 @@ void __thiscall cAISenses::InformFrom(cAISenses *this, int from) pOtherAwareness = pOtherSenses->GetHighAwareness(pOtherSenses, 3, 0x7FFFFFFF); if ( pOtherAwareness ) { - fromLoc = *cAIState::GetPortalLocation((cAIState *)this->m_pAIState); + fromLoc = *cAIState::GetPortalLocation(this->m_pAIState); toLoc = j__ObjPosGet(from)->loc; if ( AISightCast(&fromLoc, &toLoc) ) { @@ -415278,11 +414785,11 @@ void __thiscall cAISenses::InformFrom(cAISenses *this, int from) } else { - v2 = (cAIState *)pOtherAI->GetState(pOtherAI); + v2 = pOtherAI->GetState(pOtherAI); Alertness = cAIState::GetAlertness(v2); if ( pOtherAwareness->level <= Alertness ) { - v4 = (cAIState *)pOtherAI->GetState(pOtherAI); + v4 = pOtherAI->GetState(pOtherAI); level = cAIState::GetAlertness(v4); } else @@ -415293,7 +414800,7 @@ void __thiscall cAISenses::InformFrom(cAISenses *this, int from) } if ( pAwareness->linkID ) { - memcpy(&newAwareness, pAwareness, sizeof(newAwareness)); + memcpy((void *)&newAwareness, pAwareness, sizeof(newAwareness)); if ( pAwareness->lastContact < pOtherAwareness->lastContact ) { newAwareness.lastPos = pOtherAwareness->lastPos; @@ -415307,7 +414814,7 @@ void __thiscall cAISenses::InformFrom(cAISenses *this, int from) } else { - memcpy(&newAwareness, pOtherAwareness, sizeof(newAwareness)); + memcpy((void *)&newAwareness, pOtherAwareness, sizeof(newAwareness)); newAwareness.flags = 0; newAwareness.linkID = 0; newAwareness.level = otherUrgency; @@ -415344,8 +414851,8 @@ __int64 __thiscall cAISenses::GetFreeKnowledgePeriod(cAISenses *this) pMults = AIGetProperty(g_pAIAlertSenseMultsProperty, ID, &g_AIDefAlertSenseMults); v2 = cAIComponentBase::GetID(this); base = AIGetProperty(g_pAIFreeKnowledgeProperty, v2, 1500); - mult = pMults->mults[cAIState::GetAlertness((cAIState *)this->m_pAIState)].KnowledgeMult; - if ( cAIState::GetMode((cAIState *)this->m_pAIState) == kAIM_Combat ) + mult = pMults->mults[cAIState::GetAlertness(this->m_pAIState)].KnowledgeMult; + if ( cAIState::GetMode(this->m_pAIState) == kAIM_Combat ) return (__int64)((double)base * mult * pMults->CombatKnowledgeMult); else return (__int64)((double)base * mult); @@ -415355,7 +414862,7 @@ __int64 __thiscall cAISenses::GetFreeKnowledgePeriod(cAISenses *this) void __cdecl AIUpdateVisibility(int objId) { double DistanceToClosestWallSq; // st7 - int Active; // [esp+0h] [ebp-40h] + ePlayerMotion Active; // [esp+0h] [ebp-40h] int v3; // [esp+4h] [ebp-3Ch] sAIVisibility visibility; // [esp+8h] [ebp-38h] BYREF mxs_vector velocity; // [esp+1Ch] [ebp-24h] BYREF @@ -415405,7 +414912,7 @@ void __cdecl AIUpdateVisibility(int objId) if ( objId == j__get_player_object() ) { Active = j__PlayerMotionGetActive(); - if ( Active >= 3 && Active <= 5 ) + if ( Active >= kMoCrouch && Active <= kMoCrawlRight ) visibility.exposure += pVisCtrl->crouchMod; } weapObj = j__GetWeaponObjID(objId); @@ -416434,21 +415941,21 @@ floatang *__thiscall cAIDeviceSenses::GetVisionFacing(cAIDeviceSenses *this, flo sAIDeviceParams *pParams; // [esp+28h] [ebp-8h] BYREF float *jointPos; // [esp+2Ch] [ebp-4h] - ID = cAIState::GetID((cAIState *)this->m_pAIState); + ID = cAIState::GetID(this->m_pAIState); jointPos = j__ObjJointPos(ID); - v3 = cAIState::GetID((cAIState *)this->m_pAIState); - if ( g_pAIDeviceProperty->Get(g_pAIDeviceProperty, v3, &pParams) && pParams->m_jointRotate < 7u ) + v3 = cAIState::GetID(this->m_pAIState); + if ( g_pAIDeviceProperty->Get(g_pAIDeviceProperty, v3, &pParams) && pParams->m_jointRotate <= 6u ) { v8 = jointPos[pParams->m_jointRotate] * 6.283185307178 / 360.0; floatang::floatang(&a, v8); - FacingAng = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v11); + FacingAng = cAIState::GetFacingAng(this->m_pAIState, &v11); v7 = operator+(&v10, FacingAng, &a); floatang::floatang(result, v7); return result; } else { - v = cAIState::GetFacingAng((cAIState *)this->m_pAIState, &v13); + v = cAIState::GetFacingAng(this->m_pAIState, &v13); floatang::floatang(result, v); return result; } @@ -416498,7 +416005,7 @@ void __stdcall cAI::DebugDraw(cAI *this) sAIMoveGoal::sAIMoveGoal(&moveGoal); FacingAng = cAIState::GetFacingAng(&this->m_state, &result); floatang::floatang(&facing, FacingAng); - *(_QWORD *)&translate.x = 0i64; + *(_QWORD *)&translate.x = 0LL; translate.z = 0.2; cAIState::GetLocation(&this->m_state, &atLocation); r3_start_object(&translate); @@ -416598,7 +416105,7 @@ void __cdecl AIDrawOneSuggestion(const mxs_vector *loc, const sAIMoveSuggestion good = guiScreenColor(0x1FFFFFF); bad = guiScreenColor((int)&brush_faces[2049][5].d + 7); - *(_QWORD *)&translate.x = 0i64; + *(_QWORD *)&translate.x = 0LL; translate.z = 0.2; if ( suggestion->bias <= 0 ) { @@ -417095,8 +416602,8 @@ void __cdecl combatpts_report(int WarnLevel, void *data, char *buffer) cAnsiStr v24; // [esp+78h] [ebp-64h] BYREF cAnsiStr v25; // [esp+84h] [ebp-58h] BYREF cAnsiStr v26; // [esp+90h] [ebp-4Ch] BYREF - BOOL v27; // [esp+9Ch] [ebp-40h] - BOOL v28; // [esp+A0h] [ebp-3Ch] + int v27; // [esp+9Ch] [ebp-40h] + int v28; // [esp+A0h] [ebp-3Ch] int bad; // [esp+A4h] [ebp-38h] int obj; // [esp+A8h] [ebp-34h] BYREF sCoverPtProp *cpVal; // [esp+ACh] [ebp-30h] BYREF @@ -417652,8 +417159,8 @@ void __stdcall cAIBasicScript::OnAlertness( void __stdcall cAIBasicScript::OnHighAlert( cAIBasicScript *this, int source, - eAIAwareLevel previous, - eAIAwareLevel current, + eAIScriptAlertLevel previous, + eAIScriptAlertLevel current, const sAIAlertness *pRaw) { IScriptMan *Aggregated; // eax @@ -417671,7 +417178,7 @@ void __stdcall cAIBasicScript::OnHighAlert( if ( v10 ) { ID = cAIComponentBase::GetID(this); - sAIHighAlertMsg::sAIHighAlertMsg(v10, ID, (eAIScriptAlertLevel)current, (eAIScriptAlertLevel)previous); + sAIHighAlertMsg::sAIHighAlertMsg(v10, ID, current, previous); v9 = v7; } else @@ -418372,7 +417879,7 @@ void __thiscall cDABase>::Fast unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -419135,7 +418642,7 @@ eAIAwareLevel __stdcall cAIScrSrv::GetAlertLevel(cAIScrSrv *this, int objIdAI) } //----- (005FBC20) -------------------------------------------------------- -void __stdcall cAIScrSrv::SetMinimumAlert(cAIScrSrv *this, int objIdAI, eAIAwareLevel level) +void __stdcall cAIScrSrv::SetMinimumAlert(cAIScrSrv *this, int objIdAI, eAIScriptAlertLevel level) { sAIAlertCap defCap; // [esp+0h] [ebp-14h] BYREF sAIAlertCap *pAlertCap; // [esp+Ch] [ebp-8h] BYREF @@ -419673,6 +419180,7 @@ int __stdcall CDStopPlay(ICDPlayer *this) cAutoIPtr::~cAutoIPtr(&pCDPlayer); return result; } +// 5FCA50: inconsistent function type and number of purged bytes //----- (005FCA8C) -------------------------------------------------------- void CDPlayerCreate() @@ -420309,7 +419817,7 @@ int __stdcall cContainSys::GetContainer(cContainSys *this, int obj) } //----- (005FDE80) -------------------------------------------------------- -int __stdcall cContainSys::MoveAllContents(cContainSys *this, int targ, int src, int addflags) +int __stdcall cContainSys::MoveAllContents(cContainSys *this, int targ, int src, unsigned int addflags) { const cContainSys::sContainData *v4; // eax cSimpleDListIter *v5; // eax @@ -421807,7 +421315,7 @@ void __stdcall ContainInheritListener(sPropertyListenMsg *msg, PropListenerData_ IContainSys *v21; // [esp+20h] [ebp-24h] int new_obj; // [esp+24h] [ebp-20h] int containarch; // [esp+28h] [ebp-1Ch] - int skipthis; // [esp+2Ch] [ebp-18h] + BOOL skipthis; // [esp+2Ch] [ebp-18h] sContainIter *itertwo; // [esp+30h] [ebp-14h] cAutoIPtr pObjSys; // [esp+34h] [ebp-10h] BYREF cAutoIPtr pContainSys; // [esp+38h] [ebp-Ch] BYREF @@ -421979,7 +421487,7 @@ void __stdcall cContainSrv::End(cContainSrv *this) } //----- (00601270) -------------------------------------------------------- -int __stdcall cContainSrv::Add(cContainSrv *this, object obj, object container, int type, int flags) +int __stdcall cContainSrv::Add(cContainSrv *this, object obj, object container, int type, unsigned int flags) { int v5; // eax int v7; // [esp-Ch] [ebp-Ch] @@ -422413,7 +421921,7 @@ void ContrastInit() if ( config_get_raw(aContrast, 0, 0) ) { - config_get_raw(aContrast_0, buffer, 79); + config_get_raw(aContrast_0, buffer, 0x4Fu); contrast(buffer); } else @@ -424039,7 +423547,7 @@ int __stdcall cRotDoorOps::Version(cRotDoorOps *this) //----- (0060583D) -------------------------------------------------------- int __stdcall cRotDoorOps::Read(cRotDoorOps *this, sDatum *pdat, IDataOpsFile *file, int v) { - char v5[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-8h] BYREF sRotDoorProp *pRotDoorProp; // [esp+4h] [ebp-4h] if ( !pdat->value ) @@ -424061,19 +423569,18 @@ int __stdcall cRotDoorOps::Read(cRotDoorOps *this, sDatum *pdat, IDataOpsFile *f file->Read(file, &pRotDoorProp->base_closed_location, 12); file->Read(file, &pRotDoorProp->base_open_location, 12); file->Read(file, &pRotDoorProp->base_location, 12); - file->Read(file, &pRotDoorProp->base_angle, 6); + file->Read(file, (void *)&pRotDoorProp->base_angle, 6); file->Read(file, &pRotDoorProp->base, 4); file->Read(file, &pRotDoorProp->room1, 4); file->Read(file, &pRotDoorProp->room2, 4); file->Read(file, &pRotDoorProp->clockwise, 4); if ( v >= 1001 ) { - file->Read(file, &pRotDoorProp->base_closed_facing, 6); - file->Read(file, &pRotDoorProp->base_open_facing, 6); + file->Read(file, (void *)&pRotDoorProp->base_closed_facing, 6); + file->Read(file, (void *)&pRotDoorProp->base_open_facing, 6); } return 0; } -// 60583D: using guessed type char var_8[4]; //----- (00605A31) -------------------------------------------------------- IRotDoorProperty *__cdecl RotDoorPropertyInit() @@ -424170,7 +423677,7 @@ void __stdcall RotDoorListener(sPropertyListenMsg *msg, PropListenerData__ *data { if ( (msg->type & 1) == 0 ) return; - if ( pDoorProp->axis >= 3u ) + if ( pDoorProp->axis > 2u ) pDoorProp->axis = 2; if ( pDoorProp->status >= 4u ) pDoorProp->status = 0; @@ -424210,7 +423717,7 @@ int __stdcall cTransDoorOps::Version(cTransDoorOps *this) //----- (00605E35) -------------------------------------------------------- int __stdcall cTransDoorOps::Read(cTransDoorOps *this, sDatum *pdat, IDataOpsFile *file, int v) { - char v5[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-8h] BYREF sTransDoorProp *pTransDoorProp; // [esp+4h] [ebp-4h] if ( !pdat->value ) @@ -424232,13 +423739,12 @@ int __stdcall cTransDoorOps::Read(cTransDoorOps *this, sDatum *pdat, IDataOpsFil file->Read(file, &pTransDoorProp->base_closed_location, 12); file->Read(file, &pTransDoorProp->base_open_location, 12); file->Read(file, &pTransDoorProp->base_location, 12); - file->Read(file, &pTransDoorProp->base_angle, 6); + file->Read(file, (void *)&pTransDoorProp->base_angle, 6); file->Read(file, &pTransDoorProp->base, 4); file->Read(file, &pTransDoorProp->room1, 4); file->Read(file, &pTransDoorProp->room2, 4); return 0; } -// 605E35: using guessed type char var_8[4]; //----- (00605FE1) -------------------------------------------------------- ITransDoorProperty *__cdecl TransDoorPropertyInit() @@ -424332,7 +423838,7 @@ void __stdcall TransDoorListener(sPropertyListenMsg *msg, PropListenerData__ *da } else if ( (msg->type & 1) != 0 ) { - if ( pDoorProp->axis >= 3u ) + if ( pDoorProp->axis > 2u ) { pDoorProp->axis = 2; trans_door_lock = 1; @@ -425206,7 +424712,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -425220,7 +424726,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 6078A0: using guessed type char var_8[4]; //----- (00607950) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -425250,7 +424755,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -425265,7 +424770,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cRotDoorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -425273,7 +424778,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 607A00: using guessed type char var_C[4]; //----- (00607AE0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -425284,7 +424788,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -425293,7 +424797,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cRotDoorOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cRotDoorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -425308,7 +424812,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 607B70: variable 'v5' is possibly undefined -// 607AE0: using guessed type char var_C[4]; //----- (00607BB0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -425391,7 +424894,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -425403,7 +424906,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 607DD0: using guessed type char var_C[4]; //----- (00607E60) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -425427,7 +424929,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore *t //----- (00607EC0) -------------------------------------------------------- int __stdcall cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -425437,7 +424939,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStore * ((void (__stdcall *)(cRotDoorOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 607EC0: using guessed type char var_8[4]; //----- (00607F50) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -425525,7 +425026,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -425539,7 +425040,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 6080F0: using guessed type char var_8[4]; //----- (006081A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -425569,7 +425069,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -425584,7 +425084,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cTransDoorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -425592,7 +425092,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 608250: using guessed type char var_C[4]; //----- (00608330) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -425603,7 +425102,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -425612,7 +425111,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cTransDoorOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cTransDoorOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -425627,7 +425126,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 6083C0: variable 'v5' is possibly undefined -// 608330: using guessed type char var_C[4]; //----- (00608400) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -425710,7 +425208,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -425722,7 +425220,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 608620: using guessed type char var_C[4]; //----- (006086B0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -425746,7 +425243,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -425756,7 +425253,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 608710: using guessed type char var_8[4]; //----- (006087A0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -425970,7 +425466,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -425998,7 +425494,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 608D7C: variable 'v4' is possibly undefined -// 608CE0: using guessed type char var_10[4]; //----- (00608DE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -426139,7 +425634,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -426167,7 +425662,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 60916C: variable 'v4' is possibly undefined -// 6090D0: using guessed type char var_10[4]; //----- (006091D0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -426746,7 +426240,7 @@ IBoolProperty *__cdecl ProxBuildProp(char *prox_name) char *tmp_cat; // [esp+14h] [ebp-4h] ProxPropDesc = (sPropertyDesc *)j__new(0x30u, aRPrjThief2Skup_1609, 42); - memset(ProxPropDesc, 0, sizeof(sPropertyDesc)); + memset((void *)ProxPropDesc, 0, sizeof(sPropertyDesc)); strncpy(ProxPropDesc->name, prox_name, 0x10u); ProxPropDesc->flags = 16; tmp_cat = (char *)MallocSpew(6u, aRPrjThief2Skup_1610, 46); @@ -426757,7 +426251,7 @@ IBoolProperty *__cdecl ProxBuildProp(char *prox_name) strcpy(tmp_name, prox_name); ProxPropDesc->ui.friendly_name = tmp_name; pProxProp = j__CreateBoolProperty(ProxPropDesc, 1u); - operator delete(ProxPropDesc); + operator delete((void *)ProxPropDesc); return pProxProp; } @@ -426883,17 +426377,12 @@ void __thiscall cDynTexture::cDynTexture(cDynTexture *this, IUnknown *pOuter) int __stdcall cDynTexture::ChangeTexture(cDynTexture *this, int objid, int id1, int id2) { Position *pos; // [esp+0h] [ebp-8h] - float rad; // [esp+4h] [ebp-4h] BYREF + int rad; // [esp+4h] [ebp-4h] BYREF pos = j__ObjPosGet(objid); - if ( !gTextureRadiusProp->Get(gTextureRadiusProp, objid, &rad) ) - rad = 0.1; - return (*(int (__stdcall **)(cDynTexture *, Position *, _DWORD, int, int))this->gapC)( - this, - pos, - LODWORD(rad), - id1, - id2); + if ( !gTextureRadiusProp->Get(gTextureRadiusProp, objid, (float *)&rad) ) + rad = 1036831949; + return (*(int (__stdcall **)(cDynTexture *, Position *, int, int, int))this->gapC)(this, pos, rad, id1, id2); } //----- (0060A5D0) -------------------------------------------------------- @@ -426913,7 +426402,7 @@ int __stdcall cDynTexture::ChangeTexture(cDynTexture *this, Location *loc, float if ( !id1 || !id2 ) return -2147024809; - *(_QWORD *)&radvec.el[1] = 0x3F8000003F800000i64; + *(_QWORD *)&radvec.el[1] = 0x3F8000003F800000LL; radvec.x = 1.0; mx_scaleeq_vec(&radvec, rad); mx_copy_vec(&minvec, &loc->vec); @@ -427044,7 +426533,7 @@ void __cdecl BashPropsInit() IDamageModel *v2; // [esp+0h] [ebp-18h] IBashParamsProperty *v3; // [esp+4h] [ebp-14h] cBashParamsProperty *v4; // [esp+8h] [ebp-10h] - IUnknown *v5; // [esp+Ch] [ebp-Ch] + IStructDescTools *v5; // [esp+Ch] [ebp-Ch] IStructDescTools *tools; // [esp+10h] [ebp-8h] cAutoIPtr pDamage; // [esp+14h] [ebp-4h] BYREF @@ -427070,8 +426559,8 @@ void __cdecl BashPropsInit() tools->Register(tools, &BashParamsDesc); if ( tools ) tools->Release(tools); - v5 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v5->__vftable[5].QueryInterface)(v5, &bash_sdesc); + v5 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v5->Register(v5, &bash_sdesc); if ( v5 ) v5->Release(v5); v2 = cIPtr::operator->(&pDamage); @@ -427458,7 +426947,7 @@ void EngineFeaturesCreate() cAutoIPtr pLoopManager; // [esp+8h] [ebp-8h] BYREF ILoopClientFactory *factory; // [esp+Ch] [ebp-4h] - factory = CreateLoopFactory((sLoopClientDesc **)our_array); + factory = CreateLoopFactory(our_array); Aggregated = (ILoopManager *)_AppGetAggregated(&IID_ILoopManager); cAutoIPtr::cAutoIPtr(&pLoopManager, Aggregated); v1 = factory; @@ -427970,7 +427459,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -427984,7 +427473,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 60C430: using guessed type char var_8[4]; //----- (0060C4E0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -428014,7 +427502,7 @@ int __stdcall cHashPropertyStore::Get(cHashPropertyStore::Set(cHashPropertyStore *this, int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -428029,7 +427517,7 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStoremOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cBashParamsOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -428037,7 +427525,6 @@ int __stdcall cHashPropertyStore::Set(cHashPropertyStore::Set(&this->mTable, &obj, &setval); return retval; } -// 60C590: using guessed type char var_C[4]; //----- (0060C670) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -428048,7 +427535,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -428057,7 +427544,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cBashParamsOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cBashParamsOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -428072,7 +427559,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 60C700: variable 'v5' is possibly undefined -// 60C670: using guessed type char var_C[4]; //----- (0060C740) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -428158,7 +427644,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -428170,7 +427656,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 60C960: using guessed type char var_C[4]; //----- (0060C9F0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -428194,7 +427679,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -428204,7 +427689,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 60CA50: using guessed type char var_8[4]; //----- (0060CAE0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -428401,7 +427885,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -428429,7 +427913,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 60CFCC: variable 'v4' is possibly undefined -// 60CF30: using guessed type char var_10[4]; //----- (0060D030) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -428626,17 +428109,15 @@ int __cdecl FrobPropsInit() IFrobInfoProperty *v0; // eax IFrobInfoProperty *v2; // [esp+0h] [ebp-10h] cFrobInfoProperty *v3; // [esp+4h] [ebp-Ch] - IUnknown *Aggregated; // [esp+8h] [ebp-8h] + IStructDescTools *Aggregated; // [esp+8h] [ebp-8h] IStructDescTools *tools; // [esp+Ch] [ebp-4h] tools = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); tools->Register(tools, &frob_info_struct); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)( - Aggregated, - &frob_proxy_struct); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &frob_proxy_struct); if ( Aggregated ) Aggregated->Release(Aggregated); v3 = (cFrobInfoProperty *)j__new(0xC8u, aRPrjThief2Skup_1602, 199); @@ -428735,7 +428216,7 @@ cFrobInfoProperty *__thiscall cFrobInfoProperty::`vector deleting destructor'(cF //----- (0060D880) -------------------------------------------------------- int __stdcall cFrobOps::Read(cFrobOps *this, sDatum *dat, IDataOpsFile *file, unsigned int version) { - char v5[4]; // [esp+0h] [ebp-10h] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-10h] BYREF sOldFrobInfo old; // [esp+4h] [ebp-Ch] BYREF int i; // [esp+8h] [ebp-8h] sFrobInfo *young; // [esp+Ch] [ebp-4h] @@ -428750,7 +428231,6 @@ int __stdcall cFrobOps::Read(cFrobOps *this, sDatum *dat, IDataOpsFile *file, un young->actions[i] = old.actions[i]; return 0; } -// 60D880: using guessed type char var_10[4]; //----- (0060D940) -------------------------------------------------------- void __thiscall cFrobInfoProperty::~cFrobInfoProperty(cFrobInfoProperty *this) @@ -428885,7 +428365,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -428913,7 +428393,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 60DC7C: variable 'v4' is possibly undefined -// 60DBE0: using guessed type char var_10[4]; //----- (0060DCE0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -431386,7 +430865,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( sObjPropPair *v3; // eax int obj; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-18h] BYREF sObjPropPair resulta; // [esp+4h] [ebp-14h] BYREF sObjPropPair key; // [esp+Ch] [ebp-Ch] BYREF sDatum val; // [esp+14h] [ebp-4h] BYREF @@ -431408,7 +430887,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Create( return result; } // 40622B: using guessed type int j__PropPopBlame(void); -// 612130: using guessed type char var_18[4]; //----- (006121F0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Delete(cSparseHashPropertyStore *this, int obj) @@ -431465,7 +430943,7 @@ int __stdcall cSparseHashPropertyStore::Set( sObjPropPair *v3; // eax int v4; // edx int prop; // eax - char v7[4]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[4]; // [esp+0h] [ebp-1Ch] BYREF sObjPropPair result; // [esp+4h] [ebp-18h] BYREF sDatum setval; // [esp+Ch] [ebp-10h] BYREF int retval; // [esp+10h] [ebp-Ch] @@ -431485,7 +430963,7 @@ int __stdcall cSparseHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cInvRenderOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cInvRenderOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, val.value); @@ -431496,7 +430974,6 @@ int __stdcall cSparseHashPropertyStore::Set( return retval; } // 40622B: using guessed type int j__PropPopBlame(void); -// 612310: using guessed type char var_1C[4]; //----- (00612400) -------------------------------------------------------- sDatum *__stdcall cSparseHashPropertyStore::Copy( @@ -431510,7 +430987,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( void **v7; // eax sDatum v8; // [esp+0h] [ebp-20h] BYREF sObjPropPair v9; // [esp+4h] [ebp-1Ch] BYREF - char v10[4]; // [esp+Ch] [ebp-14h] BYREF + _BYTE v10[4]; // [esp+Ch] [ebp-14h] BYREF sObjPropPair resulta; // [esp+10h] [ebp-10h] BYREF sDatum targval; // [esp+18h] [ebp-8h] BYREF sDatum srcval; // [esp+1Ch] [ebp-4h] BYREF @@ -431519,7 +430996,7 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( v4 = cSparseHashPropertyStore::Key(this, &resulta, targ); if ( cHashTable::Lookup(this->mTable, v4, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cInvRenderOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cInvRenderOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v10, srcval.value); @@ -431538,7 +431015,6 @@ sDatum *__stdcall cSparseHashPropertyStore::Copy( } // 61249A: variable 'v7' is possibly undefined // 40622B: using guessed type int j__PropPopBlame(void); -// 612400: using guessed type char var_14[4]; //----- (006124E0) -------------------------------------------------------- int __stdcall cSparseHashPropertyStore::Reset(cSparseHashPropertyStore *this) @@ -431629,7 +431105,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -431641,7 +431117,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 612750: using guessed type char var_C[4]; //----- (006127E0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -431665,7 +431140,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -431675,7 +431150,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 612840: using guessed type char var_8[4]; //----- (006128D0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy(cPropertyStore *this, int __formal, sDatum val) @@ -431976,7 +431450,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -432004,7 +431478,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 61305C: variable 'v4' is possibly undefined -// 612FC0: using guessed type char var_10[4]; //----- (006130C0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -432890,16 +432363,16 @@ void __cdecl key_report(int obj, int WarnLevel, void *data, char *buffer, eRepor const char *v7; // eax const char *v8; // eax const char *v9; // eax - int v10; // [esp-8h] [ebp-34h] - unsigned int region_mask; // [esp-8h] [ebp-34h] - int v12; // [esp-4h] [ebp-30h] - int v13; // [esp-4h] [ebp-30h] + unsigned int v10; // [esp-8h] [ebp-34h] + unsigned int v11; // [esp-8h] [ebp-34h] + unsigned int region_mask; // [esp-4h] [ebp-30h] int lock_id; // [esp-4h] [ebp-30h] + int v14; // [esp-4h] [ebp-30h] sKeyInfo *pKeyDst; // [esp+4h] [ebp-28h] BYREF int i; // [esp+8h] [ebp-24h] int any_work; // [esp+Ch] [ebp-20h] sKeyInfo *pKeySrc; // [esp+10h] [ebp-1Ch] BYREF - int v19; // [esp+14h] [ebp-18h] BYREF + sKeyInfo *v19; // [esp+14h] [ebp-18h] BYREF int src_idx; // [esp+18h] [ebp-14h] int dst_idx; // [esp+1Ch] [ebp-10h] sKeyInfo *pKeyData; // [esp+20h] [ebp-Ch] BYREF @@ -432935,20 +432408,20 @@ void __cdecl key_report(int obj, int WarnLevel, void *data, char *buffer, eRepor { for ( src_idx = 0; src_idx < src_cnt; ++src_idx ) { - if ( KeySrcProp->Get(KeySrcProp, src_list[src_idx], (sKeyInfo **)&v19) ) + if ( KeySrcProp->Get(KeySrcProp, src_list[src_idx], &v19) ) { - if ( *(_BYTE *)v19 ) + if ( v19->master_bit ) { - v12 = *(_DWORD *)(v19 + 1); + region_mask = v19->region_mask; v5 = j__ObjEditName(src_list[src_idx]); - j__rsprintf(&p, "%s is a Master Key for region mask %x\n", v5, v12); + j__rsprintf(&p, "%s is a Master Key for region mask %x\n", v5, region_mask); } else { - v13 = *(unsigned __int8 *)(v19 + 5); - v10 = *(_DWORD *)(v19 + 1); + lock_id = v19->lock_id; + v10 = v19->region_mask; v6 = j__ObjEditName(src_list[src_idx]); - j__rsprintf(&p, "%s is a normal Key region %x lock id %d\n", v6, v10, v13); + j__rsprintf(&p, "%s is a normal Key region %x lock id %d\n", v6, v10, lock_id); } } else @@ -432963,10 +432436,10 @@ void __cdecl key_report(int obj, int WarnLevel, void *data, char *buffer, eRepor KeyDstProp->Get(KeyDstProp, dst_list[dst_idx], &pKeyDst); if ( loud ) { - lock_id = pKeyDst->lock_id; - region_mask = pKeyDst->region_mask; + v14 = pKeyDst->lock_id; + v11 = pKeyDst->region_mask; v7 = j__ObjEditName(dst_list[dst_idx]); - j__rsprintf(&p, "%s is a lock for region %x lock id %d\n opened by ", v7, region_mask, lock_id); + j__rsprintf(&p, "%s is a lock for region %x lock id %d\n opened by ", v7, v11, v14); } for ( i = 0; i < src_cnt; ++i ) { @@ -433222,7 +432695,7 @@ cKeyInfoProperty *__thiscall cKeyInfoProperty::`vector deleting destructor'(cKey //----- (00615790) -------------------------------------------------------- int __stdcall cKeyOps::Read(cKeyOps *this, sDatum *dat, IDataOpsFile *file, unsigned int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sOldKeyInfo old; // [esp+4h] [ebp-8h] BYREF sKeyInfo *young; // [esp+8h] [ebp-4h] @@ -433237,7 +432710,6 @@ int __stdcall cKeyOps::Read(cKeyOps *this, sDatum *dat, IDataOpsFile *file, unsi young->lock_id = old.lock_id; return 0; } -// 615790: using guessed type char var_C[4]; //----- (00615840) -------------------------------------------------------- void __thiscall cKeyInfoProperty::~cKeyInfoProperty(cKeyInfoProperty *this) @@ -433418,7 +432890,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -433446,7 +432918,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 615CDC: variable 'v4' is possibly undefined -// 615C40: using guessed type char var_10[4]; //----- (00615D40) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -434219,7 +433690,7 @@ void create_movie_factory() { descs[0] = &cMovieClient::Descriptor; descs[1] = 0; - fact = CreateLoopFactory((sLoopClientDesc **)descs); + fact = CreateLoopFactory(descs); Aggregated = (ILoopManager *)_AppGetAggregated(&IID_ILoopManager); cAutoIPtr::cAutoIPtr(&pLoopMan, Aggregated); v1 = fact; @@ -434386,7 +433857,7 @@ void __cdecl GetUnclippedBBox(int obj, int *mn, int *mx) r3_start_object_angles(&pos->loc.vec, &pos->fac, 6); r3_push_clip_plane(&g_Plane); savemode = r3_get_clipmode(); - r3_set_clipmode(2); + r3_set_clipmode(R3_USER_CLIP); saveflags = r3_get_clip_flags(); r3_set_clip_flags(0); vec[6].x = bmin.x; @@ -434480,7 +433951,7 @@ void PickFrameUpdate() player_camera = j__get_player_camera(); j__CameraGetLocation(player_camera, &g_CamVec, &g_CamAngle); mx_ang2mat(&m, &g_CamAngle); - *(_QWORD *)&v.x = 1065353216i64; + *(_QWORD *)&v.x = 1065353216LL; v.z = 0.0; mx_mat_mul_vec((mxs_vector *)&g_Plane, &m, &v); mx_scale_add_vec(&v2, &g_CamVec, (const mxs_vector *)&g_Plane, 1.0); @@ -434723,7 +434194,7 @@ int __cdecl launchProjectile( float v22; // [esp+2Ch] [ebp-12Ch] float Radius; // [esp+34h] [ebp-124h] IObjectSystem *v24; // [esp+38h] [ebp-120h] - int v25; // [esp+3Ch] [ebp-11Ch] + BOOL v25; // [esp+3Ch] [ebp-11Ch] int v26; // [esp+40h] [ebp-118h] cTag v27; // [esp+44h] [ebp-114h] BYREF cAutoIPtr pAIManager; // [esp+54h] [ebp-104h] BYREF @@ -434940,7 +434411,7 @@ int __cdecl launchProjectile( } else { - *(_QWORD *)&default_vel.x = 1065353216i64; + *(_QWORD *)&default_vel.x = 1065353216LL; default_vel.z = 0.0; } if ( (flags & 1) != 0 || !j__PhysObjHasPhysics(launcher) ) @@ -435023,7 +434494,7 @@ void __cdecl compute_firer_pos(int firer, mxs_vector *pos, mxs_angvec *ang, cons if ( dir ) { mx_norm_vec((mxs_vector *)&orien, dir); - *(_QWORD *)&z_vec.x = 0i64; + *(_QWORD *)&z_vec.x = 0LL; z_vec.z = 1.0; mx_cross_vec(&orien.vec[1], &z_vec, (const mxs_vector *)&orien); mx_cross_vec(&orien.vec[2], (const mxs_vector *)&orien, &orien.vec[1]); @@ -435745,11 +435216,11 @@ void __cdecl fillParms(sfx_parm *parm, sfx_net_parm *net_parm) parm->loop_callback = 0; parm->user_data = 0; parm->pSndSource = 0; - parm->end_callback = soundNetEndCallback; + parm->end_callback = (void (__cdecl *)(int, void *))soundNetEndCallback; } //----- (0061A0F9) -------------------------------------------------------- -void __cdecl soundNetEndCallback(int localHandle, void *pClientData) +void __cdecl soundNetEndCallback(unsigned int localHandle, void *pClientData) { int ownHandle; // [esp+0h] [ebp-4h] BYREF @@ -435774,17 +435245,17 @@ void __cdecl fillParmsSmall(sfx_parm *parm, sfx_small_net_parm *net_parm) parm->loop_callback = 0; parm->user_data = 0; parm->pSndSource = 0; - parm->end_callback = soundNetEndCallback; + parm->end_callback = (void (__cdecl *)(int, void *))soundNetEndCallback; } //----- (0061A1BC) -------------------------------------------------------- void __cdecl handleSoundObj( - int handle, + unsigned int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, - int owner) + unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -435793,11 +435264,17 @@ void __cdecl handleSoundObj( } //----- (0061A1F6) -------------------------------------------------------- -void __cdecl makeSoundObj(int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, int owner) +void __cdecl makeSoundObj( + unsigned int handle, + int objID, + int schemaID, + unsigned __int8 sampleNum, + sfx_parm *parm, + unsigned int owner) { const char *sampleName; // [esp+0h] [ebp-10h] sSchemaPlayParams *pPlayParams; // [esp+4h] [ebp-Ch] - int localHandle; // [esp+8h] [ebp-8h] + unsigned int localHandle; // [esp+8h] [ebp-8h] float atten_factor; // [esp+Ch] [ebp-4h] parm->flag |= 0x10000u; @@ -435826,26 +435303,26 @@ int __cdecl OwnHandle(unsigned int owner, unsigned int handle) } //----- (0061A2F3) -------------------------------------------------------- -void __cdecl soundNetAddMapping(int remoteHandle, int localHandle, int owner) +void __cdecl soundNetAddMapping(unsigned int remoteHandle, unsigned int localHandle, unsigned int owner) { int ownHandle; // [esp+0h] [ebp-4h] BYREF if ( localHandle != -1 ) { ownHandle = OwnHandle(owner, remoteHandle); - cHashTable::Set(&HandleMap, &ownHandle, &localHandle); + cHashTable::Set(&HandleMap, &ownHandle, (const int *)&localHandle); cDWORDSet::Add(&ClientSet, localHandle); } } //----- (0061A334) -------------------------------------------------------- void __cdecl handleSmallSoundObj( - int handle, + unsigned int handle, int objID, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, - int owner) + unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -435911,12 +435388,12 @@ void __cdecl SoundNetGenerateSoundObj( //----- (0061A4EA) -------------------------------------------------------- void __cdecl handleSoundVec( - int handle, + unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_net_parm *net_parms, - int owner) + unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -435926,16 +435403,16 @@ void __cdecl handleSoundVec( //----- (0061A524) -------------------------------------------------------- void __cdecl makeSoundVec( - int handle, + unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_parm *parm, - int owner) + unsigned int owner) { const char *sampleName; // [esp+0h] [ebp-10h] sSchemaPlayParams *pPlayParams; // [esp+4h] [ebp-Ch] - int localHandle; // [esp+8h] [ebp-8h] + unsigned int localHandle; // [esp+8h] [ebp-8h] float atten_factor; // [esp+Ch] [ebp-4h] parm->flag |= 0x10000u; @@ -435959,12 +435436,12 @@ void __cdecl makeSoundVec( //----- (0061A615) -------------------------------------------------------- void __cdecl handleSmallSoundVec( - int handle, + unsigned int handle, mxs_vector *vec, int schemaID, unsigned __int8 sampleNum, sfx_small_net_parm *net_parms, - int owner) + unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -436029,7 +435506,7 @@ void __cdecl SoundNetGenerateSoundVec( // 61A695: variable 'v7' is possibly undefined //----- (0061A7CB) -------------------------------------------------------- -void __cdecl handleSound(int handle, const char *sampleName, sfx_net_parm *net_parms, int owner) +void __cdecl handleSound(unsigned int handle, const char *sampleName, sfx_net_parm *net_parms, unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -436038,9 +435515,9 @@ void __cdecl handleSound(int handle, const char *sampleName, sfx_net_parm *net_p } //----- (0061A7FD) -------------------------------------------------------- -void __cdecl makeSound(int handle, const char *sampleName, sfx_parm *parm, int owner) +void __cdecl makeSound(unsigned int handle, const char *sampleName, sfx_parm *parm, unsigned int owner) { - int localHandle; // [esp+0h] [ebp-4h] + unsigned int localHandle; // [esp+0h] [ebp-4h] parm->flag ^= 0x8000u; parm->user_data = (void *)OwnHandle(owner, handle); @@ -436049,7 +435526,11 @@ void __cdecl makeSound(int handle, const char *sampleName, sfx_parm *parm, int o } //----- (0061A854) -------------------------------------------------------- -void __cdecl handleSmallSound(int handle, const char *sampleName, sfx_small_net_parm *net_parms, int owner) +void __cdecl handleSmallSound( + unsigned int handle, + const char *sampleName, + sfx_small_net_parm *net_parms, + unsigned int owner) { sfx_parm parm; // [esp+0h] [ebp-38h] BYREF @@ -436070,7 +435551,7 @@ void __cdecl SoundNetGenerateSound(int handle, const char *sampleName, sfx_parm } //----- (0061A8EE) -------------------------------------------------------- -void __cdecl handleSoundHalt(int handle, int owner) +void __cdecl handleSoundHalt(unsigned int handle, unsigned int owner) { int ownHandle; // [esp+0h] [ebp-8h] BYREF int localHandle; // [esp+4h] [ebp-4h] BYREF @@ -436085,7 +435566,7 @@ void __cdecl handleSoundHalt(int handle, int owner) } //----- (0061A949) -------------------------------------------------------- -void __cdecl SoundNetHalt(int handle) +void __cdecl SoundNetHalt(unsigned int handle) { if ( !cDWORDSet::InSet(&ClientSet, handle) ) g_pSoundHaltMsg->cNetMsg::Send(g_pSoundHaltMsg, 0, handle); @@ -436792,7 +436273,7 @@ void __cdecl BroadcastTweqEmitStop(int obj) int __cdecl processTweqAxis(float *val, sTweqBaseConfig *cfg, sTweqBaseState *state, mxs_vector *limits, int ms) { float v6; // [esp+14h] [ebp-2Ch] - int is_end; // [esp+1Ch] [ebp-24h] + BOOL is_end; // [esp+1Ch] [ebp-24h] int halt_action; // [esp+20h] [ebp-20h] int clip; // [esp+24h] [ebp-1Ch] float v10; // [esp+28h] [ebp-18h] @@ -437039,7 +436520,7 @@ int __cdecl processTweqScale(int obj, sTweqVectorState *state, int ms) { if ( !j__ObjGetScale(obj, &scale) ) { - *(_QWORD *)&scale.el[1] = 0x3F8000003F800000i64; + *(_QWORD *)&scale.el[1] = 0x3F8000003F800000LL; scale.x = 1.0; } rv = processTweqVector(&scale, vec_state, vec_cfg, ms); @@ -437078,7 +436559,7 @@ void __cdecl get_anchor(int obj, char flag, mxs_vector *pos) if ( (flag & 1) != 0 ) { j__ObjGetObjOffsetBBox(obj, pos, &dummy); - *(_QWORD *)&pos->x = 0i64; + *(_QWORD *)&pos->x = 0LL; } else { @@ -437932,27 +437413,27 @@ int do_launches() //----- (0061E4B0) -------------------------------------------------------- int __cdecl actOnObj(int obj, sTweqBaseState *state, int (__cdecl *process_call)(int, void *, int)) { - int rv; // [esp+4h] [ebp-8h] + eTweqOperation rv; // [esp+4h] [ebp-8h] int remains; // [esp+8h] [ebp-4h] remains = 1; if ( obj >= 0 && (state->flg_anim & 1) != 0 ) { rv = process_call(obj, state, cur_ms); - if ( rv != 3 ) + if ( rv != kTweqOpStatusQuo ) { - if ( rv == 2 ) + if ( rv == kTweqOpHaltTweq ) state->flg_anim &= ~1u; if ( cur_type != kTweqTypeNull ) - j__SendTweqMessage(obj, cur_type, (eTweqOperation)rv, (eTweqDirection)((state->flg_anim & 2) == 0)); + j__SendTweqMessage(obj, cur_type, rv, (eTweqDirection)((state->flg_anim & 2) == 0)); if ( rv ) { - if ( rv == 1 ) + if ( rv == kTweqOpRemoveTweq ) { cur_prop->Delete(cur_prop, obj); return 0; } - else if ( rv == 4 ) + else if ( rv == kTweqOpSlayAll ) { cur_dmgmodel->SlayObject(cur_dmgmodel, obj, 0, 0); return 0; @@ -439661,7 +439142,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -439689,7 +439170,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 62161C: variable 'v4' is possibly undefined -// 621580: using guessed type char var_10[4]; //----- (00621680) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -440136,7 +439616,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -440164,7 +439644,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 62203C: variable 'v4' is possibly undefined -// 621FA0: using guessed type char var_10[4]; //----- (006220A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -440611,7 +440090,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -440639,7 +440118,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 622A62: variable 'v4' is possibly undefined -// 6229C0: using guessed type char var_10[4]; //----- (00622AC0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -441086,7 +440564,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -441114,7 +440592,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 62347C: variable 'v4' is possibly undefined -// 6233E0: using guessed type char var_10[4]; //----- (006234E0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -441564,7 +441041,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -441592,7 +441069,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 623E9C: variable 'v4' is possibly undefined -// 623E00: using guessed type char var_10[4]; //----- (00623F00) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -442039,7 +441515,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -442067,7 +441543,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6248BC: variable 'v4' is possibly undefined -// 624820: using guessed type char var_10[4]; //----- (00624920) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -442525,7 +442000,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -442553,7 +442028,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6252DC: variable 'v4' is possibly undefined -// 625240: using guessed type char var_10[4]; //----- (00625340) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -443011,7 +442485,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -443039,7 +442513,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 625D1C: variable 'v4' is possibly undefined -// 625C80: using guessed type char var_10[4]; //----- (00625D80) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -443486,7 +442959,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -443514,7 +442987,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 62673C: variable 'v4' is possibly undefined -// 6266A0: using guessed type char var_10[4]; //----- (006267A0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -443970,7 +443442,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -443998,7 +443470,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 62716C: variable 'v4' is possibly undefined -// 6270D0: using guessed type char var_10[4]; //----- (006271D0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -445454,9 +444925,9 @@ void __cdecl do_generic_props(int obj, IProperty *prop, eTweqDo action, __int16 //----- (00629A39) -------------------------------------------------------- void __cdecl do_modify_state(sTweqBaseState *state, eTweqDo action, __int16 xtra_bits) { - __int16 v3; // cx - __int16 v4; // ax - __int16 bits; // [esp+4h] [ebp-8h] + unsigned __int16 v3; // cx + unsigned __int16 v4; // ax + unsigned __int16 bits; // [esp+4h] [ebp-8h] bits = state->flg_anim; switch ( action ) @@ -446346,9 +445817,9 @@ unsigned int TermWeaponHaloSystem() } //----- (0062B76B) -------------------------------------------------------- -int __cdecl WeaponHaloInflated(int weapon) +BOOL __cdecl WeaponHaloInflated(int weapon) { - int has_links; // [esp+0h] [ebp-8h] + BOOL has_links; // [esp+0h] [ebp-8h] ILinkQuery *query; // [esp+4h] [ebp-4h] query = pWHInflatedLinks->Query(pWHInflatedLinks, 0, weapon); @@ -446371,9 +445842,9 @@ BOOL __cdecl WeaponSubmodIsHalo(int weapon, int submod) } //----- (0062B81C) -------------------------------------------------------- -int __cdecl WeaponHaloIsBlocking(int objID) +BOOL __cdecl WeaponHaloIsBlocking(int objID) { - int has_links; // [esp+0h] [ebp-8h] + BOOL has_links; // [esp+0h] [ebp-8h] ILinkQuery *query; // [esp+4h] [ebp-4h] if ( !objID ) @@ -446388,11 +445859,11 @@ int __cdecl WeaponHaloIsBlocking(int objID) } //----- (0062B88C) -------------------------------------------------------- -int __cdecl WeaponGetBlockingHalo(int objID, int *haloId) +BOOL __cdecl WeaponGetBlockingHalo(int objID, int *haloId) { int v2; // eax int v3; // eax - int has_links; // [esp+0h] [ebp-Ch] + BOOL has_links; // [esp+0h] [ebp-Ch] ILinkQuery *query; // [esp+8h] [ebp-4h] if ( !haloId ) @@ -451481,7 +450952,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -451495,7 +450966,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 633910: using guessed type char var_8[4]; //----- (006339C0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -451535,7 +451005,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -451553,7 +451023,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -451561,7 +451031,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 633A70: using guessed type char var_C[4]; //----- (00633B50) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -451572,7 +451041,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -451581,7 +451050,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -451596,7 +451065,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 633BE0: variable 'v5' is possibly undefined -// 633B50: using guessed type char var_C[4]; //----- (00633C20) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -451686,7 +451154,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -451698,7 +451166,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 633E40: using guessed type char var_C[4]; //----- (00633ED0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -451729,7 +451196,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -451739,7 +451206,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 633F30: using guessed type char var_8[4]; //----- (00633FC0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -451823,7 +451289,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -451837,7 +451303,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 634150: using guessed type char var_8[4]; //----- (00634200) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -451873,7 +451338,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -451888,7 +451353,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cAIGunDescDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cAIGunDescDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -451896,7 +451361,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 6342B0: using guessed type char var_C[4]; //----- (00634390) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -451907,7 +451371,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -451916,7 +451380,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cAIGunDescDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cAIGunDescDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -451931,7 +451395,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 634420: variable 'v5' is possibly undefined -// 634390: using guessed type char var_C[4]; //----- (00634460) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -452020,7 +451483,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452032,7 +451495,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 634680: using guessed type char var_C[4]; //----- (00634710) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -452056,7 +451518,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -452066,7 +451528,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 634770: using guessed type char var_8[4]; //----- (00634800) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -452163,7 +451624,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -452177,7 +451638,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 6349B0: using guessed type char var_8[4]; //----- (00634A60) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -452217,7 +451677,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452235,7 +451695,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -452243,7 +451703,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 634B10: using guessed type char var_C[4]; //----- (00634BF0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -452254,7 +451713,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -452263,7 +451722,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cClassDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -452278,7 +451737,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 634C80: variable 'v5' is possibly undefined -// 634BF0: using guessed type char var_C[4]; //----- (00634CC0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -452368,7 +451826,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452380,7 +451838,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 634EE0: using guessed type char var_C[4]; //----- (00634F70) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion( @@ -452411,7 +451868,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -452421,7 +451878,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cClassDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 634FD0: using guessed type char var_8[4]; //----- (00635060) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -452512,7 +451968,7 @@ sDatum *__stdcall cHashPropertyStore>::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -452526,7 +451982,6 @@ sDatum *__stdcall cHashPropertyStore>::Create( result->value = val.value; return result; } -// 635200: using guessed type char var_8[4]; //----- (006352B0) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Delete( @@ -452566,7 +452021,7 @@ int __stdcall cHashPropertyStore>::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452584,7 +452039,7 @@ int __stdcall cHashPropertyStore>::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -452592,7 +452047,6 @@ int __stdcall cHashPropertyStore>::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 635360: using guessed type char var_C[4]; //----- (00635440) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore>::Copy( @@ -452603,7 +452057,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -452612,7 +452066,7 @@ sDatum *__stdcall cHashPropertyStore>::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cNoZeroDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -452627,7 +452081,6 @@ sDatum *__stdcall cHashPropertyStore>::Copy( return result; } // 6354D0: variable 'v5' is possibly undefined -// 635440: using guessed type char var_C[4]; //----- (00635510) -------------------------------------------------------- int __stdcall cHashPropertyStore>::Reset( @@ -452717,7 +452170,7 @@ int __stdcall cPropertyStore>::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452729,7 +452182,6 @@ int __stdcall cPropertyStore>::ReadObj( ((void (__stdcall *)(cPropertyStore > *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 635730: using guessed type char var_C[4]; //----- (006357C0) -------------------------------------------------------- int __stdcall cPropertyStore>::WriteVersion(cPropertyStore > *this) @@ -452759,7 +452211,7 @@ int __stdcall cPropertyStore>::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -452769,7 +452221,6 @@ int __stdcall cPropertyStore>::GetCopy( ((void (__stdcall *)(cNoZeroDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 635820: using guessed type char var_8[4]; //----- (006358B0) -------------------------------------------------------- int __stdcall cPropertyStore>::ReleaseCopy( @@ -452853,7 +452304,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -452867,7 +452318,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 635A40: using guessed type char var_8[4]; //----- (00635AF0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete( @@ -452907,7 +452357,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -452922,7 +452372,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cGunReliabilityDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cGunReliabilityDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -452930,7 +452380,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 635BA0: using guessed type char var_C[4]; //----- (00635C80) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -452941,7 +452390,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -452950,7 +452399,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cGunReliabilityDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cGunReliabilityDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -452965,7 +452414,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 635D10: variable 'v5' is possibly undefined -// 635C80: using guessed type char var_C[4]; //----- (00635D50) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -453054,7 +452502,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -453066,7 +452514,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 635F70: using guessed type char var_C[4]; //----- (00636000) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -453096,7 +452543,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -453106,7 +452553,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cGunReliabilityDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 636060: using guessed type char var_8[4]; //----- (006360F0) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -453196,7 +452642,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -453210,7 +452656,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 636290: using guessed type char var_8[4]; //----- (00636340) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -453246,7 +452691,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -453261,7 +452706,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cGunStateDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cGunStateDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -453269,7 +452714,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 6363F0: using guessed type char var_C[4]; //----- (006364D0) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -453280,7 +452724,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -453289,7 +452733,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cGunStateDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cGunStateDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -453304,7 +452748,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 636560: variable 'v5' is possibly undefined -// 6364D0: using guessed type char var_C[4]; //----- (006365A0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -453393,7 +452836,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -453405,7 +452848,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 6367C0: using guessed type char var_C[4]; //----- (00636850) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -453429,7 +452871,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -453439,7 +452881,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 6368B0: using guessed type char var_8[4]; //----- (00636940) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -453529,7 +452970,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -453543,7 +452984,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 636AE0: using guessed type char var_8[4]; //----- (00636B90) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -453579,7 +453019,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -453594,7 +453034,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cCannisterDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cCannisterDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -453602,7 +453042,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 636C40: using guessed type char var_C[4]; //----- (00636D20) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -453613,7 +453052,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -453622,7 +453061,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cCannisterDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cCannisterDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -453637,7 +453076,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 636DB0: variable 'v5' is possibly undefined -// 636D20: using guessed type char var_C[4]; //----- (00636DF0) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -453726,7 +453164,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -453738,7 +453176,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 637010: using guessed type char var_C[4]; //----- (006370A0) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -453762,7 +453199,7 @@ int __stdcall cPropertyStore::SetOps(cPropertyStore::GetCopy(cPropertyStore *this, int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -453772,7 +453209,6 @@ int __stdcall cPropertyStore::GetCopy(cPropertyStoremOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 637100: using guessed type char var_8[4]; //----- (00637190) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -454423,7 +453859,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -454451,7 +453887,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 63825C: variable 'v4' is possibly undefined -// 6381C0: using guessed type char var_10[4]; //----- (006382C0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -454564,7 +453999,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -454592,7 +454027,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6385BC: variable 'v4' is possibly undefined -// 638520: using guessed type char var_10[4]; //----- (00638620) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -454702,7 +454136,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -454730,7 +454164,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6388FC: variable 'v4' is possibly undefined -// 638860: using guessed type char var_10[4]; //----- (00638960) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -454846,7 +454279,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -454874,7 +454307,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 638C4C: variable 'v4' is possibly undefined -// 638BB0: using guessed type char var_10[4]; //----- (00638CB0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -455086,7 +454518,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -455114,7 +454546,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 639222: variable 'v4' is possibly undefined -// 639180: using guessed type char var_10[4]; //----- (00639280) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -455300,7 +454731,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -455328,7 +454759,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6397BC: variable 'v4' is possibly undefined -// 639720: using guessed type char var_10[4]; //----- (00639820) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -455472,7 +454902,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -455500,7 +454930,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 639BEC: variable 'v4' is possibly undefined -// 639B50: using guessed type char var_10[4]; //----- (00639C50) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -456496,7 +455925,7 @@ sDatum *__stdcall cHashPropertyStore::Create( sDatum *result, int __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum val; // [esp+4h] [ebp-4h] BYREF if ( !__$ReturnUdt ) @@ -456510,7 +455939,6 @@ sDatum *__stdcall cHashPropertyStore::Create( result->value = val.value; return result; } -// 63B350: using guessed type char var_8[4]; //----- (0063B400) -------------------------------------------------------- int __stdcall cHashPropertyStore::Delete(cHashPropertyStore *this, int obj) @@ -456546,7 +455974,7 @@ int __stdcall cHashPropertyStore::Set( int obj, sDatum val) { - char v4[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-Ch] BYREF sDatum setval; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -456561,7 +455989,7 @@ int __stdcall cHashPropertyStore::Set( } else { - setval.value = *(void **)((int (__stdcall *)(cProjectileDataOps *, char *, void *))this->mOps.CopyNew)( + setval.value = *(void **)((int (__stdcall *)(cProjectileDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v4, val.value); @@ -456569,7 +455997,6 @@ int __stdcall cHashPropertyStore::Set( cHashTable::Set(&this->mTable, &obj, &setval); return retval; } -// 63B4B0: using guessed type char var_C[4]; //----- (0063B590) -------------------------------------------------------- sDatum *__stdcall cHashPropertyStore::Copy( @@ -456580,7 +456007,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( { void **v5; // eax sDatum v6; // [esp+0h] [ebp-10h] BYREF - char v7[4]; // [esp+4h] [ebp-Ch] BYREF + _BYTE v7[4]; // [esp+4h] [ebp-Ch] BYREF sDatum targval; // [esp+8h] [ebp-8h] BYREF sDatum srcval; // [esp+Ch] [ebp-4h] BYREF @@ -456589,7 +456016,7 @@ sDatum *__stdcall cHashPropertyStore::Copy( sDatum::sDatum(&srcval, 0); if ( cHashTable::Lookup(&this->mTable, &targ, &srcval) ) { - targval.value = *(void **)((int (__stdcall *)(cProjectileDataOps *, char *, void *))this->mOps.CopyNew)( + targval.value = *(void **)((int (__stdcall *)(cProjectileDataOps *, _BYTE *, void *))this->mOps.CopyNew)( &this->mOps, v7, srcval.value); @@ -456604,7 +456031,6 @@ sDatum *__stdcall cHashPropertyStore::Copy( return result; } // 63B620: variable 'v5' is possibly undefined -// 63B590: using guessed type char var_C[4]; //----- (0063B660) -------------------------------------------------------- int __stdcall cHashPropertyStore::Reset(cHashPropertyStore *this) @@ -456693,7 +456119,7 @@ int __stdcall cPropertyStore::ReadObj( IDataOpsFile *file, int version) { - char v5[4]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v5[4]; // [esp+0h] [ebp-Ch] BYREF sDatum dat; // [esp+4h] [ebp-8h] BYREF int retval; // [esp+8h] [ebp-4h] @@ -456705,7 +456131,6 @@ int __stdcall cPropertyStore::ReadObj( ((void (__stdcall *)(cPropertyStore *, int, void *))this->Set)(this, obj, dat.value); return retval; } -// 63B880: using guessed type char var_C[4]; //----- (0063B910) -------------------------------------------------------- int __stdcall cPropertyStore::WriteVersion(cPropertyStore *this) @@ -456732,7 +456157,7 @@ int __stdcall cPropertyStore::GetCopy( int obj, sDatum *val) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum dat; // [esp+4h] [ebp-4h] BYREF sDatum::sDatum(&dat, 0); @@ -456742,7 +456167,6 @@ int __stdcall cPropertyStore::GetCopy( ((void (__stdcall *)(cProjectileDataOps *, sDatum *, void *))this->mOps.Copy)(&this->mOps, val, dat.value); return 1; } -// 63B970: using guessed type char var_8[4]; //----- (0063BA00) -------------------------------------------------------- int __stdcall cPropertyStore::ReleaseCopy( @@ -456966,7 +456390,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -456994,7 +456418,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 63BF8C: variable 'v4' is possibly undefined -// 63BEF0: using guessed type char var_10[4]; //----- (0063BFF0) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -457836,8 +457259,8 @@ int __stdcall stim_msg_func(sReactionEvent *event, const sReactionParam *__forma sStimEvent *stim; // edx object v5; // [esp-10h] [ebp-64h] BYREF float intensity; // [esp-Ch] [ebp-60h] - int sensor; // [esp-8h] [ebp-5Ch] - int source; // [esp-4h] [ebp-58h] + unsigned int sensor; // [esp-8h] [ebp-5Ch] + unsigned int source; // [esp-4h] [ebp-58h] int v9; // [esp+0h] [ebp-54h] sStimMsg msg; // [esp+8h] [ebp-4Ch] BYREF IScriptMan *pScriptMan; // [esp+50h] [ebp-4h] @@ -457887,7 +457310,7 @@ void __cdecl add_stim_message_receptron(int obj, int stim) v8 = cIPtr::operator->(&query); if ( v8->Done(v8) ) { - memset(&tron, 0, sizeof(tron)); + memset((void *)&tron, 0, sizeof(tron)); param = (sStimMsgParam *)&tron.effect.param.data; tron.trigger.flags = 3; tron.effect.kind = stim_msg_reaction; @@ -457905,7 +457328,7 @@ void __cdecl add_stim_message_receptron(int obj, int stim) v9 = cIPtr::operator->(&query); v9->Next(v9); } - qmemcpy(©tron, v13, sizeof(copytron)); + qmemcpy((void *)©tron, v13, sizeof(copytron)); if ( (copytron.effect.param.data.bits[4] & 1) != 0 ) { ++*(_DWORD *)copytron.effect.param.data.bits; @@ -457953,7 +457376,7 @@ void __cdecl rem_stim_message_receptron(int obj, int stim) tron = v9->Receptron(v9); if ( tron->effect.kind == stim_msg_reaction ) { - qmemcpy(©tron, tron, sizeof(copytron)); + qmemcpy((void *)©tron, tron, sizeof(copytron)); if ( (copytron.effect.param.data.bits[4] & 1) != 0 ) { if ( --*(_DWORD *)copytron.effect.param.data.bits ) @@ -458174,7 +457597,7 @@ unsigned int __stdcall cActReactSrv::GetReactionNamed(cActReactSrv *this, const } //----- (0063DFD0) -------------------------------------------------------- -cScrStr *__stdcall cActReactSrv::GetReactionName(cActReactSrv *this, cScrStr *result, int __$ReturnUdt) +cScrStr *__stdcall cActReactSrv::GetReactionName(cActReactSrv *this, cScrStr *result, unsigned int __$ReturnUdt) { const char *v3; // eax IReactions *v5; // [esp+0h] [ebp-4h] @@ -462457,9 +461880,9 @@ cScrVec *__stdcall cObjectSrv::Position(cObjectSrv *this, cScrVec *result, objec } //----- (006449F0) -------------------------------------------------------- -void __thiscall cScrVec::cScrVec(cScrVec *this, cScrVec *v) +void __thiscall cScrVec::cScrVec(cScrVec *this, const mxs_vector *v) { - *this = *v; + this->mxs_vector = *v; } //----- (00644A30) -------------------------------------------------------- @@ -464391,7 +463814,7 @@ int __cdecl SndScriptRestartSavedSounds(cSoundRecord *sndDat) //----- (00647B49) -------------------------------------------------------- int __cdecl SndScrptGen( Label *lname, - int iFlags, + unsigned int iFlags, int call, int targ, int obj2, @@ -464478,11 +463901,11 @@ void __cdecl SndScriptSendSavedMsg(cSoundRecord *sndDat) cAnsiStr *v4; // eax const char *v5; // eax sSchemaDoneMsg *v6; // eax - const char *v7; // eax + sSoundDoneMsg *v7; // eax cScrVec v8; // [esp-10h] [ebp-54h] BYREF Label *p_m_Name; // [esp-4h] [ebp-48h] IScriptMan *v10; // [esp+0h] [ebp-44h] - const char *v11; // [esp+4h] [ebp-40h] + sSoundDoneMsg *v11; // [esp+4h] [ebp-40h] IScriptMan *v12; // [esp+8h] [ebp-3Ch] sSchemaDoneMsg *v13; // [esp+Ch] [ebp-38h] Label *v14; // [esp+10h] [ebp-34h] @@ -464490,7 +463913,7 @@ void __cdecl SndScriptSendSavedMsg(cSoundRecord *sndDat) sSchemaDoneMsg *v16; // [esp+20h] [ebp-24h] cAnsiStr v17; // [esp+24h] [ebp-20h] BYREF cAnsiStr v18; // [esp+30h] [ebp-14h] BYREF - const char *v19; // [esp+3Ch] [ebp-8h] + sSoundDoneMsg *v19; // [esp+3Ch] [ebp-8h] sSchemaDoneMsg *pMsg; // [esp+40h] [ebp-4h] sndDat->m_CallbackObjID = j__ObjRemapOnLoad(sndDat->m_CallbackObjID); @@ -464559,7 +463982,7 @@ void __cdecl SndScriptSendSavedMsg(cSoundRecord *sndDat) v10 = cLazyAggMember::operator->(&pScriptMan_1); v10->PostMessage(v10, (sScrMsg *)p_m_Name); if ( v19 ) - (*(void (__stdcall **)(const char *))(*(_DWORD *)v19 + 8))(v19); + v19->Release(v19); } } // 647D88: variable 'v2' is possibly undefined @@ -464804,7 +464227,7 @@ void __cdecl ActiveSchemaDoneCallback(int iHandle, int iSchemaID) // 648459: variable 'v13' is possibly undefined //----- (0064848E) -------------------------------------------------------- -void __cdecl SFXParamsSetup(sfx_parm *pParams, int iFlags, eSoundNetwork net) +void __cdecl SFXParamsSetup(sfx_parm *pParams, unsigned int iFlags, eSoundNetwork net) { unsigned int flag; // eax @@ -465128,7 +464551,7 @@ unsigned __int8 __cdecl PlayAndRememberSchema( int CallObjID, int TargObjID, mxs_vector *pCoord, - int iFlags, + unsigned int iFlags, eSoundNetwork Network) { const char *v6; // eax @@ -465243,7 +464666,7 @@ unsigned __int8 __cdecl PlayAndRememberEnvSchema( int Obj2, cTagSet *pTagSet, mxs_vector *pCoord, - int iFlags, + unsigned int iFlags, eEnvSoundLoc loc, eSoundNetwork Network) { @@ -465591,7 +465014,7 @@ void __thiscall sSoundDoneMsg::sSoundDoneMsg(sSoundDoneMsg *this) //----- (00649CB0) -------------------------------------------------------- BOOL __thiscall sPersistent::Persistent(sPersistent *this, cScrVec *v) { - return sPersistent::gm_pfnIO(sPersistent::gm_pContextIO, v, 0xCu) == 12; + return sPersistent::gm_pfnIO(sPersistent::gm_pContextIO, (void *)v, 0xCu) == 12; } //----- (00649CF0) -------------------------------------------------------- @@ -465731,7 +465154,7 @@ true_bool *__stdcall cSoundScrSrv::Play( v11 = Location; v10 = SoundName; v7 = cScrStr::operator char const *(CallbackObjID); - v8 = PlayAndRememberSound(v7, ScriptID, 0, v10, 0, v11, v12); + v8 = PlayAndRememberSound(v7, ScriptID, 0, &v10->mxs_vector, 0, v11, v12); true_bool::true_bool(result, v8); return result; } @@ -465793,7 +465216,7 @@ true_bool *__stdcall cSoundScrSrv::PlaySchema( v9 = ScriptID; v8 = ScriptID; v5 = object::operator int(&CallbackObjID); - v6 = PlayAndRememberSchema(v5, v8, v9, &Coordinates, 32, v10); + v6 = PlayAndRememberSchema(v5, v8, v9, &Coordinates, 0x20u, v10); true_bool::true_bool(result, v6); return result; } @@ -465826,7 +465249,7 @@ true_bool *__stdcall cSoundScrSrv::PlaySchema( v10 = TargetObj; v9 = ScriptID; v6 = object::operator int(&CallbackObjID); - v7 = PlayAndRememberSchema(v6, v9, TargetID, &Coordinates, 32, v10); + v7 = PlayAndRememberSchema(v6, v9, TargetID, &Coordinates, 0x20u, v10); true_bool::true_bool(result, v7); return result; } @@ -465850,7 +465273,7 @@ true_bool *__stdcall cSoundScrSrv::PlaySchema( v10 = Location; v9 = Schema; v6 = object::operator int(&CallbackObjID); - v7 = PlayAndRememberSchema(v6, ScriptID, 0, v9, 64, v10); + v7 = PlayAndRememberSchema(v6, ScriptID, 0, &v9->mxs_vector, 0x40u, v10); true_bool::true_bool(result, v7); return result; } @@ -465896,7 +465319,7 @@ true_bool *__stdcall cSoundScrSrv::PlayEnvSchema( const char *v8; // eax int v9; // eax unsigned __int8 v10; // al - int v12; // [esp-Ch] [ebp-30h] + unsigned int v12; // [esp-Ch] [ebp-30h] eEnvSoundLoc v13; // [esp-8h] [ebp-2Ch] eSoundNetwork v14; // [esp-4h] [ebp-28h] Position *Pos; // [esp+0h] [ebp-24h] @@ -466435,7 +465858,7 @@ void __thiscall cRoom::cRoom(cRoom *this, void (__cdecl *movefunc)(void *, unsig cDynArray *v6; // eax cDynArray *v7; // eax int *v8; // eax - int v9; // [esp-4h] [ebp-2Ch] + unsigned int v9; // [esp-4h] [ebp-2Ch] cRoomPortal *v10; // [esp+0h] [ebp-28h] cRoomPortal *v12; // [esp+8h] [ebp-20h] int j; // [esp+Ch] [ebp-1Ch] @@ -467925,39 +467348,39 @@ mxs_vector *__cdecl PolygonNormal(mxs_vector *result, int n, mxs_vector *vert) { if ( -0.995 >= norm.x ) { - *(_QWORD *)&norm.x = 3212836864i64; + *(_QWORD *)&norm.x = 3212836864LL; norm.z = 0.0; } } else { - *(_QWORD *)&norm.x = 1065353216i64; + *(_QWORD *)&norm.x = 1065353216LL; norm.z = 0.0; } if ( norm.y < 0.995 ) { if ( -0.995 >= norm.y ) { - *(_QWORD *)&norm.x = 0xBF80000000000000ui64; + *(_QWORD *)&norm.x = 0xBF80000000000000uLL; norm.z = 0.0; } } else { - *(_QWORD *)&norm.x = 0x3F80000000000000i64; + *(_QWORD *)&norm.x = 0x3F80000000000000LL; norm.z = 0.0; } if ( norm.z < 0.995 ) { if ( -0.995 >= norm.z ) { - *(_QWORD *)&norm.x = 0i64; + *(_QWORD *)&norm.x = 0LL; norm.z = -1.0; } } else { - *(_QWORD *)&norm.x = 0i64; + *(_QWORD *)&norm.x = 0LL; norm.z = 1.0; } if ( fabs(norm.x) <= 0.0049999999 ) @@ -468044,7 +467467,7 @@ int __cdecl PolyClip( for ( i = 0; i < src_n; ++i ) { this_side = point_side[i]; - if ( (last_side ^ this_side) == -2 ) + if ( (last_side ^ this_side) == 0xFFFFFFFE ) ++on_count; if ( this_side <= 0 ) { @@ -468118,7 +467541,7 @@ int __cdecl PolyClip( j = src_n - 1; for ( i = 0; i < src_n; ++i ) { - if ( (point_side[j] ^ point_side[i]) == -2 ) + if ( (point_side[j] ^ point_side[i]) == 0xFFFFFFFE ) { dist = point_dist[i] - point_dist[j]; s = -point_dist[j] / dist; @@ -468457,7 +467880,7 @@ void __thiscall cDABase>::FastDeleteItem( unsigned int index) { char *v2; // eax - unsigned int last; // [esp+4h] [ebp-4h] + int last; // [esp+4h] [ebp-4h] if ( index >= this->m_nItems ) { @@ -468889,7 +468312,7 @@ void __cdecl db_message_9(DispatchData *msg) } break; case 2u: - if ( (msg->subtype & 0x1D00) == 256 || (msg->subtype & 0x800) != 0 ) + if ( (msg->subtype & 0x1D00) == 0x100 || (msg->subtype & 0x800) != 0 ) { if ( setup_tagfile_4(data, &RoomSystemTag, &RoomSystemVersion) ) { @@ -468998,7 +468421,7 @@ void __thiscall cRoomPropAgent::PropagateBF(cRoomPropAgent *this, const mxs_vect cRoom *pNewRoom; // [esp+28h] [ebp-44h] int new_room_id; // [esp+2Ch] [ebp-40h] float room_dist; // [esp+30h] [ebp-3Ch] - int add_room; // [esp+34h] [ebp-38h] + BOOL add_room; // [esp+34h] [ebp-38h] int active_room_ptr; // [esp+38h] [ebp-34h] float adj_dist; // [esp+3Ch] [ebp-30h] int k; // [esp+40h] [ebp-2Ch] @@ -470353,7 +469776,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -470381,7 +469804,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 652B4C: variable 'v4' is possibly undefined -// 652AB0: using guessed type char var_10[4]; //----- (00652BB0) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -470852,7 +470274,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -470880,7 +470302,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 65362C: variable 'v4' is possibly undefined -// 653590: using guessed type char var_10[4]; //----- (00653690) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -475531,7 +474952,7 @@ int __thiscall cPropSnd::ShouldNetworkSound( if ( v12->ObjLocalOnly(v12, srcObject) ) return 0; } - if ( (flags & 0x80) != 0 ) + if ( flags < 0 ) return 1; if ( onObject ) { @@ -477071,7 +476492,7 @@ void __thiscall cPropSndInst::BumpActiveSound(cPropSndInst *this, cPlayerSoundLi char *v2; // eax unsigned int flags; // eax char *v4; // eax - int found; // [esp+4h] [ebp-10h] + BOOL found; // [esp+4h] [ebp-10h] int j; // [esp+8h] [ebp-Ch] int i; // [esp+Ch] [ebp-8h] cSoundInfo *pSoundInfo; // [esp+10h] [ebp-4h] @@ -478076,7 +477497,7 @@ int __thiscall cPropSndInstHigh::EnterCallback( double v8; // st7 double v9; // st6 cSoundInfo *v10; // eax - int m_Flags; // eax + unsigned int m_Flags; // eax int v12; // eax cDList *v13; // eax cDList *v14; // eax @@ -478326,7 +477747,7 @@ void __thiscall cSoundInfo::cSoundInfo(cSoundInfo *this, const cSoundInfo *info) v2 = &info->sSoundInfo; else v2 = 0; - qmemcpy(&this->sSoundInfo, v2, sizeof(this->sSoundInfo)); + qmemcpy((void *)&this->sSoundInfo, v2, sizeof(this->sSoundInfo)); } //----- (00663490) -------------------------------------------------------- @@ -479412,11 +478833,11 @@ int __stdcall cContactPropagator::SourceEvent(cContactPropagator *this, sStimSou cContactPropagator::cSourceList *v2; // eax cContactPropagator::cSourceList *v4; // [esp+4h] [ebp-24h] cContactPropagator::cSourceList *v5; // [esp+14h] [ebp-14h] - char v6[8]; // [esp+18h] [ebp-10h] BYREF - cSimpleListSet *v7; // [esp+20h] [ebp-8h] + _BYTE v6[8]; // [esp+18h] [ebp-10h] BYREF + cContactPropagator::cSourceList *v7; // [esp+20h] [ebp-8h] cContactPropagator::cSourceList *src; // [esp+24h] [ebp-4h] BYREF - if ( *(_DWORD *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + if ( *(_DWORD *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, v6, event->id) != event->elems.obj ) @@ -479435,7 +478856,7 @@ int __stdcall cContactPropagator::SourceEvent(cContactPropagator *this, sStimSou if ( !cSimpleListSet::Size(v7) ) { if ( v7 ) - cContactPropagator::cSourceList::`scalar deleting destructor'((cContactPropagator::cSourceList *)v7, 1u); + cContactPropagator::cSourceList::`scalar deleting destructor'(v7, 1u); cHashTable>::Delete( &this->Sources, &event->elems.obj); @@ -479475,7 +478896,6 @@ int __stdcall cContactPropagator::SourceEvent(cContactPropagator *this, sStimSou return 0; } // 665956: variable 'v2' is possibly undefined -// 6658AE: using guessed type char var_10[8]; //----- (00665A33) -------------------------------------------------------- double __stdcall cContactPropagator::GetSourceLevel(cContactPropagator *this, unsigned int id) @@ -479528,7 +478948,7 @@ void __thiscall cContactPropagator::DoPropagationEvent( int v10; // edx char *v11; // eax double Mass; // st7 - char v14[8]; // [esp+4h] [ebp-C4h] BYREF + _BYTE v14[8]; // [esp+4h] [ebp-C4h] BYREF cSimpleDListIter result; // [esp+Ch] [ebp-BCh] BYREF sStimEvent event; // [esp+14h] [ebp-B4h] BYREF sStimEventData evdat; // [esp+3Ch] [ebp-8Ch] BYREF @@ -479552,7 +478972,7 @@ void __thiscall cContactPropagator::DoPropagationEvent( while ( !cSimpleDListIter::Done(&iter) ) { srcid = *cSimpleDListIter::Value(&iter); - v9 = (int *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + v9 = (int *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, v14, srcid); @@ -479610,7 +479030,6 @@ void __thiscall cContactPropagator::DoPropagationEvent( } } } -// 665AA5: using guessed type char var_C4[8]; //----- (00665CD4) -------------------------------------------------------- unsigned int __thiscall cContactPropagator::HandleImpact(cContactPropagator *this, const sDamageMsg *msg) @@ -480700,7 +480119,7 @@ void __thiscall cPeriodicPropagator::cPeriodicPropagator( cCTUnaggregated::cCTUnaggregated(this); cPeriodicPropagator::cContactQueue::cContactQueue(&this->mQueue); - qmemcpy(&this->mDesc, desc, sizeof(this->mDesc)); + qmemcpy((void *)&this->mDesc, desc, sizeof(this->mDesc)); cPeriodicPropagator::cSourceTable::cSourceTable(&this->mSourceTable); this->mRemoving = 0; this->mInSim = 0; @@ -480853,14 +480272,14 @@ int __stdcall cPeriodicPropagator::SourceEvent(cPeriodicPropagator *this, sStimS cPeriodicPropagator::cSourceList *v9; // [esp+14h] [ebp-38h] cPeriodicPropagator::sContactElem v10; // [esp+24h] [ebp-28h] BYREF cPeriodicPropagator::cSourceList *v11; // [esp+2Ch] [ebp-20h] - char v12[8]; // [esp+30h] [ebp-1Ch] BYREF - cSimpleListSet *v13; // [esp+38h] [ebp-14h] + _BYTE v12[8]; // [esp+30h] [ebp-1Ch] BYREF + cPeriodicPropagator::cSourceList *v13; // [esp+38h] [ebp-14h] int id; // [esp+3Ch] [ebp-10h] cPeriodicPropagator::sContact *contact; // [esp+40h] [ebp-Ch] cAutoLinkQuery query; // [esp+44h] [ebp-8h] BYREF cPeriodicPropagator::cSourceList *src; // [esp+48h] [ebp-4h] BYREF - if ( *(_DWORD *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->mpSources->GetSourceElems)( + if ( *(_DWORD *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->mpSources->GetSourceElems)( this->mpSources, v12, event->id) != event->elems.obj ) @@ -480879,7 +480298,7 @@ int __stdcall cPeriodicPropagator::SourceEvent(cPeriodicPropagator *this, sStimS if ( !cSimpleListSet::Size(v13) ) { if ( v13 ) - cPeriodicPropagator::cSourceList::`scalar deleting destructor'((cPeriodicPropagator::cSourceList *)v13, 1u); + cPeriodicPropagator::cSourceList::`scalar deleting destructor'(v13, 1u); cHashTable>::Delete( &this->mSourceTable, &event->elems.obj); @@ -480940,7 +480359,6 @@ int __stdcall cPeriodicPropagator::SourceEvent(cPeriodicPropagator *this, sStimS } // 668428: variable 'v2' is possibly undefined // 66853D: variable 'v3' is possibly undefined -// 668380: using guessed type char var_1C[8]; //----- (00668690) -------------------------------------------------------- void __thiscall cPeriodicPropagator::sContactElem::sContactElem( @@ -481049,7 +480467,7 @@ int __stdcall cPeriodicPropagator::Propagate(cPeriodicPropagator *this, unsigned cSimpleDListNode *v16; // edx cSimpleDListNode *v17; // eax cSimpleDListIter v19; // [esp+4h] [ebp-78h] BYREF - char v20[8]; // [esp+Ch] [ebp-70h] BYREF + _BYTE v20[8]; // [esp+Ch] [ebp-70h] BYREF cSimpleDListIter v21; // [esp+14h] [ebp-68h] BYREF cSimpleDListIter result; // [esp+1Ch] [ebp-60h] BYREF cSimpleDListNode *Node; // [esp+24h] [ebp-58h] @@ -481085,7 +480503,7 @@ int __stdcall cPeriodicPropagator::Propagate(cPeriodicPropagator *this, unsigned contact = (cPeriodicPropagator::sContact *)this->mpContacts->GetData(this->mpContacts, elem.id); if ( (contact->flags & 1) != 0 ) { - next_time = 0x1FFFFFFFFi64; + next_time = 0x1FFFFFFFFLL; ((void (__thiscall *)(IRelation *, IRelation *, int, sLink *))this->mpContacts->Get)( this->mpContacts, this->mpContacts, @@ -481107,7 +480525,7 @@ int __stdcall cPeriodicPropagator::Propagate(cPeriodicPropagator *this, unsigned while ( !cSimpleDListIter::Done(&srciter) ) { srcid = *cSimpleDListIter::Value(&srciter); - v11 = (int *)((int (__thiscall *)(IStimSources *, IStimSources *, char *, unsigned int))this->mpSources->GetSourceElems)( + v11 = (int *)((int (__thiscall *)(IStimSources *, IStimSources *, _BYTE *, unsigned int))this->mpSources->GetSourceElems)( this->mpSources, this->mpSources, v20, @@ -481199,7 +480617,6 @@ int __stdcall cPeriodicPropagator::Propagate(cPeriodicPropagator *this, unsigned return 0; } // 6688A0: variables would overlap: ^60.8 and stkvar "next_time" ^60.4(has user info),stkvar "expired" ^64.4(has user info) -// 6688A0: using guessed type char var_70[8]; //----- (00668E00) -------------------------------------------------------- int __thiscall cPeriodicPropagator::GenerateEvents( @@ -482492,7 +481909,7 @@ int __stdcall cPropagation::AddPropagatorStimulus(cPropagation *this, unsigned i int v5; // edx int v6; // eax cGatorList *v8; // [esp+0h] [ebp-2Ch] - char v9[8]; // [esp+4h] [ebp-28h] BYREF + _BYTE v9[8]; // [esp+4h] [ebp-28h] BYREF cGatorList *v10; // [esp+Ch] [ebp-20h] sStimSensorEvent event; // [esp+10h] [ebp-1Ch] BYREF cGatorList *gators; // [esp+20h] [ebp-Ch] BYREF @@ -482526,7 +481943,7 @@ int __stdcall cPropagation::AddPropagatorStimulus(cPropagation *this, unsigned i event.id = query->ID(query); event.elems.obj = 0; event.elems.stim = 0; - v4 = (int *)((int (__stdcall *)(IStimSensorQuery *, char *))query->Elems)(query, v9); + v4 = (int *)((int (__stdcall *)(IStimSensorQuery *, _BYTE *))query->Elems)(query, v9); v5 = *v4; v6 = v4[1]; event.elems.obj = v5; @@ -482539,7 +481956,6 @@ int __stdcall cPropagation::AddPropagatorStimulus(cPropagation *this, unsigned i return 0; } // 66B383: variable 'v3' is possibly undefined -// 66B33B: using guessed type char var_28[8]; //----- (0066B479) -------------------------------------------------------- int __stdcall cPropagation::RemovePropagatorStimulus(cPropagation *this, unsigned int id, int stim) @@ -482547,7 +481963,7 @@ int __stdcall cPropagation::RemovePropagatorStimulus(cPropagation *this, unsigne int *v4; // eax int v5; // edx int v6; // eax - char v7[8]; // [esp+0h] [ebp-78h] BYREF + _BYTE v7[8]; // [esp+0h] [ebp-78h] BYREF unsigned int srcid; // [esp+8h] [ebp-70h] sStimSourceDesc desc; // [esp+Ch] [ebp-6Ch] BYREF IStimSourceQuery *i; // [esp+58h] [ebp-20h] @@ -482568,7 +481984,7 @@ int __stdcall cPropagation::RemovePropagatorStimulus(cPropagation *this, unsigne event.id = query->ID(query); event.elems.obj = 0; event.elems.stim = 0; - v4 = (int *)((int (__stdcall *)(IStimSensorQuery *, char *))query->Elems)(query, v7); + v4 = (int *)((int (__stdcall *)(IStimSensorQuery *, _BYTE *))query->Elems)(query, v7); v5 = *v4; v6 = v4[1]; event.elems.obj = v5; @@ -482593,7 +482009,6 @@ int __stdcall cPropagation::RemovePropagatorStimulus(cPropagation *this, unsigne i->Release(i); return 0; } -// 66B479: using guessed type char var_78[8]; //----- (0066B613) -------------------------------------------------------- int __stdcall cPropagation::SupportsStimulus(cPropagation *this, unsigned int id, int stim) @@ -482684,14 +482099,14 @@ int __stdcall cPropagation::SimpleSensorEvent(cPropagation *this, unsigned int i int *v3; // eax int v4; // edx int v5; // eax - char v7[8]; // [esp+0h] [ebp-18h] BYREF + _BYTE v7[8]; // [esp+0h] [ebp-18h] BYREF sStimSensorEvent event; // [esp+8h] [ebp-10h] BYREF event.type = kind; event.id = id; event.elems.obj = 0; event.elems.stim = 0; - v3 = (int *)((int (__stdcall *)(IStimSensors *, char *, unsigned int))this->pSensors->GetSensorElems)( + v3 = (int *)((int (__stdcall *)(IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetSensorElems)( this->pSensors, v7, id); @@ -482702,7 +482117,6 @@ int __stdcall cPropagation::SimpleSensorEvent(cPropagation *this, unsigned int i this->SensorEvent(this, &event); return 0; } -// 66B7DE: using guessed type char var_18[8]; //----- (0066B835) -------------------------------------------------------- int __stdcall cPropagation::SourceEvent(cPropagation *this, sStimSourceEvent *event) @@ -482734,13 +482148,13 @@ int __stdcall cPropagation::SimpleSourceEvent(cPropagation *this, unsigned int i int *v3; // eax int v4; // edx int v5; // eax - char v7[8]; // [esp+0h] [ebp-1Ch] BYREF + _BYTE v7[8]; // [esp+0h] [ebp-1Ch] BYREF sStimSourceEvent event; // [esp+8h] [ebp-14h] BYREF event.type = kind; event.id = id; memset(&event.elems, 0, 12); - v3 = (int *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + v3 = (int *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, v7, id); @@ -482752,7 +482166,6 @@ int __stdcall cPropagation::SimpleSourceEvent(cPropagation *this, unsigned int i this->SourceEvent(this, &event); return 0; } -// 66B8D3: using guessed type char var_1C[8]; //----- (0066B934) -------------------------------------------------------- int __stdcall cPropagation::Propagate(cPropagation *this, unsigned int t, unsigned int dt) @@ -483950,7 +483363,7 @@ void __thiscall cBasePropagator::cBasePropagator(cBasePropagator *this, sPropaga { cUnknownPropagator::cUnknownPropagator(this); this->InSim = 0; - qmemcpy(&this->Desc, desc, sizeof(this->Desc)); + qmemcpy((void *)&this->Desc, desc, sizeof(this->Desc)); this->pStimulator = (IStimulator *)_AppGetAggregated(&IID_IStimulator); this->pPropagation = (IPropagation *)_AppGetAggregated(&IID_IPropagation); this->__vftable = (cBasePropagator_vtbl *)&cBasePropagator::`vftable'; @@ -484595,7 +484008,7 @@ void __thiscall cRadiusPropagator::GenerateEvents( int *v5; // eax int v6; // edx int v7; // eax - char v9[8]; // [esp+4h] [ebp-1834h] BYREF + _BYTE v9[8]; // [esp+4h] [ebp-1834h] BYREF unsigned int sensid; // [esp+Ch] [ebp-182Ch] int obj; // [esp+10h] [ebp-1828h] ObjRef *r; // [esp+14h] [ebp-1824h] @@ -484607,16 +484020,17 @@ void __thiscall cRadiusPropagator::GenerateEvents( int cells[512]; // [esp+2Ch] [ebp-180Ch] BYREF unsigned __int8 visited[4096]; // [esp+82Ch] [ebp-100Ch] BYREF int c; // [esp+182Ch] [ebp-Ch] - sObjStimPair elems; // [esp+1830h] [ebp-8h] BYREF + int elems; // [esp+1830h] [ebp-8h] BYREF + int v22; // [esp+1834h] [ebp-4h] - v5 = (int *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->mpSources->GetSourceElems)( + v5 = (int *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->mpSources->GetSourceElems)( this->mpSources, v9, srcid); v6 = *v5; v7 = v5[1]; - elems.obj = v6; - elems.stim = v7; + elems = v6; + v22 = v7; shape = (const cRadiusPropagator::sShape *)&desc->shape; pos = j__ObjPosGet(v6); if ( pos ) @@ -484632,16 +484046,15 @@ void __thiscall cRadiusPropagator::GenerateEvents( obj = r->obj; if ( !visited[obj] ) { - sensid = this->mpSensors->LookupSensor(this->mpSensors, obj, elems.stim); + sensid = this->mpSensors->LookupSensor(this->mpSensors, obj, v22); if ( sensid ) - cRadiusPropagator::GenerateOneEvent(this, t, srcid, desc, &elems, obj, sensid, flags); + cRadiusPropagator::GenerateOneEvent(this, t, srcid, desc, (const sObjStimPair *)&elems, obj, sensid, flags); visited[obj] = 1; } } } } } -// 66F07B: using guessed type char var_1834[8]; //----- (0066F23A) -------------------------------------------------------- int __stdcall cRadiusPropagator::SourceEvent(cRadiusPropagator *this, sStimSourceEvent *event) @@ -485374,7 +484787,7 @@ int __thiscall cReactions::Init(cReactions *this) //----- (006704CA) -------------------------------------------------------- void __cdecl install_built_ins(IReactions *r) { - IUnknown *Aggregated; // [esp+0h] [ebp-8h] + IStructDescTools *Aggregated; // [esp+0h] [ebp-8h] IStructDescTools *tools; // [esp+4h] [ebp-4h] r->Add(r, &abort_desc, abort_func, 0); @@ -485383,8 +484796,8 @@ void __cdecl install_built_ins(IReactions *r) if ( tools ) tools->Release(tools); r->Add(r, &lify_desc, amplify_func, 0); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)(Aggregated, &WeakPoint_sdesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &WeakPoint_sdesc); if ( Aggregated ) Aggregated->Release(Aggregated); r->Add(r, &WeakPoint_desc, WeakPoint_func, 0); @@ -487009,7 +486422,7 @@ unsigned int __stdcall cStimSensors::AddReceptron(cStimSensors *this, int obj, i int id; // [esp+8h] [ebp-40h] sReceptron addme; // [esp+Ch] [ebp-3Ch] BYREF - qmemcpy(&addme, tron, sizeof(addme)); + qmemcpy((void *)&addme, tron, sizeof(addme)); if ( addme.order ) { if ( this->NextOrder <= ++addme.order ) @@ -487047,7 +486460,7 @@ int __stdcall cStimSensors::GetReceptron(cStimSensors *this, unsigned int tronid getron = (sReceptron *)this->pReceptrons->GetData(this->pReceptrons, id); if ( !getron ) return -2147467259; - qmemcpy(tron, getron, sizeof(sReceptron)); + qmemcpy((void *)tron, getron, sizeof(sReceptron)); return 0; } @@ -487530,7 +486943,7 @@ int __stdcall cReceptronDataOps::Read(cReceptronDataOps *this, sDatum *dat, IDat int v10; // eax int v11; // eax int v12; // eax - char v13[4]; // [esp+4h] [ebp-120h] BYREF + _BYTE v13[4]; // [esp+4h] [ebp-120h] BYREF int i; // [esp+8h] [ebp-11Ch] sReactionDesc dummy; // [esp+Ch] [ebp-118h] BYREF int success; // [esp+90h] [ebp-94h] @@ -487544,9 +486957,9 @@ int __stdcall cReceptronDataOps::Read(cReceptronDataOps *this, sDatum *dat, IDat if ( !dat->value ) dat->value = this->New(this, v13)->value; tron = (sReceptron *)dat->value; - memset(tron, 0, sizeof(sReceptron)); + memset((void *)tron, 0, sizeof(sReceptron)); len = 0; - v5 = file->Read(file, tron, 4); + v5 = file->Read(file, (void *)tron, 4); len += v5; v6 = file->Read(file, &tron->trigger, 12); len += v6; @@ -487573,7 +486986,7 @@ int __stdcall cReceptronDataOps::Read(cReceptronDataOps *this, sDatum *dat, IDat } else { - v11 = file->Read(file, param, 40); + v11 = file->Read(file, (void *)param, 40); len += v11; for ( i = 0; i < 2; ++i ) { @@ -487588,7 +487001,6 @@ int __stdcall cReceptronDataOps::Read(cReceptronDataOps *this, sDatum *dat, IDat dat->value = 0; return -2147467259; } -// 674B10: using guessed type char var_120[4]; //----- (00674E30) -------------------------------------------------------- cReceptronDataOps *__thiscall cReceptronDataOps::`vector deleting destructor'(cReceptronDataOps *this, char __flags) @@ -487971,8 +487383,8 @@ sDatum *__stdcall cClassDataOps::New(cClassDataOps *this resulta = (sReceptron *)j__new(0x3Cu, aRPrjThief2Skup_31, 57); if ( (this->mFlags & 1) != 0 ) - memset(resulta, 0, sizeof(sReceptron)); - sDatum::sDatum(result, resulta); + memset((void *)resulta, 0, sizeof(sReceptron)); + sDatum::sDatum(result, (void *)resulta); return result; } @@ -488034,7 +487446,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -488062,7 +487474,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 675ACC: variable 'v4' is possibly undefined -// 675A30: using guessed type char var_10[4]; //----- (00675B30) -------------------------------------------------------- int __stdcall cClassDataOps::Write(cClassDataOps *this, sDatum val, IDataOpsFile *file) @@ -488642,16 +488053,17 @@ void __thiscall cStimSources::RemoveInheritanceLink(cStimSources *this, int obj, } //----- (006769F3) -------------------------------------------------------- +// local variable allocation has failed, the output may be wrong! void __thiscall cStimSources::RecomputeSources(cStimSources *this) { int v1; // eax int v2; // eax sStimSourceEvent event; // [esp+4h] [ebp-50h] BYREF sStimSourceData *srcdata; // [esp+18h] [ebp-3Ch] - sObjStimPair v6; // [esp+1Ch] [ebp-38h] BYREF + sObjStimPair v6; // [esp+1Ch] [ebp-38h] OVERLAPPED BYREF unsigned int descid; // [esp+28h] [ebp-2Ch] int linkid; // [esp+2Ch] [ebp-28h] - _DWORD *v9; // [esp+30h] [ebp-24h] + sStimSourceData *v9; // [esp+30h] [ebp-24h] unsigned int id; // [esp+34h] [ebp-20h] sLink link; // [esp+38h] [ebp-1Ch] BYREF sStimSourceData *data; // [esp+44h] [ebp-10h] @@ -488689,9 +488101,9 @@ void __thiscall cStimSources::RecomputeSources(cStimSources *this) 0, 0); !query->Done(query); query->Next(query) ) { - v9 = query->Data(query); + v9 = (sStimSourceData *)query->Data(query); linkid = query->ID(query); - if ( v9[2] ) + if ( v9->count ) { query->Link(query, (sLink *)&v6); event.type = 0; @@ -488714,6 +488126,7 @@ void __thiscall cStimSources::RecomputeSources(cStimSources *this) if ( query ) query->Release(query); } +// 6769F3: variables would overlap: ^28.8 and stkvar "var_38" ^28.4(has user info) //----- (00676C70) -------------------------------------------------------- int __thiscall cStimSources::Link2Source(cStimSources *this, int id) @@ -489259,7 +488672,7 @@ unsigned int __stdcall cSourceDescDataOps::Write(cSourceDescDataOps *this, sDatu int __stdcall cSourceDescDataOps::Read(cSourceDescDataOps *this, sDatum *dat, IDataOpsFile *file, int version) { unsigned int v4; // eax - char v6[4]; // [esp+0h] [ebp-34h] BYREF + _BYTE v6[4]; // [esp+0h] [ebp-34h] BYREF IPropagator *gator; // [esp+4h] [ebp-30h] sPropagatorDesc gatordesc; // [esp+8h] [ebp-2Ch] BYREF int len; // [esp+2Ch] [ebp-8h] @@ -489282,7 +488695,7 @@ int __stdcall cSourceDescDataOps::Read(cSourceDescDataOps *this, sDatum *dat, ID if ( len != 54 ) goto fail; } - len = file->Read(file, &gatordesc, 32); + len = file->Read(file, (void *)&gatordesc, 32); if ( len != 32 ) { fail: @@ -489299,7 +488712,6 @@ int __stdcall cSourceDescDataOps::Read(cSourceDescDataOps *this, sDatum *dat, ID gator = 0; return 0; } -// 6780F0: using guessed type char var_34[4]; //----- (00678270) -------------------------------------------------------- cSourceDescDataOps *__thiscall cSourceDescDataOps::`vector deleting destructor'(cSourceDescDataOps *this, char __flags) @@ -489570,7 +488982,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -489598,7 +489010,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 6789FC: variable 'v4' is possibly undefined -// 678960: using guessed type char var_10[4]; //----- (00678A60) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -489702,7 +489113,7 @@ int __stdcall cClassDataOps::Read( _DWORD *v4; // eax unsigned int v6; // [esp+0h] [ebp-1Ch] sDatum v7; // [esp+8h] [ebp-14h] BYREF - char v8[4]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[4]; // [esp+Ch] [ebp-10h] BYREF char *v9; // [esp+10h] [ebp-Ch] int size; // [esp+14h] [ebp-8h] char *buf; // [esp+18h] [ebp-4h] @@ -489730,7 +489141,6 @@ int __stdcall cClassDataOps::Read( return 0; } // 678CEC: variable 'v4' is possibly undefined -// 678C50: using guessed type char var_10[4]; //----- (00678D50) -------------------------------------------------------- int __stdcall cClassDataOps::Write( @@ -489870,8 +489280,8 @@ void __thiscall cStimulator::remap_obj_params(cStimulator *this, const sStimEven int *v4; // eax int v5; // eax int *v6; // eax - char v8[8]; // [esp+4h] [ebp-18h] BYREF - char v9[8]; // [esp+Ch] [ebp-10h] BYREF + _BYTE v8[8]; // [esp+4h] [ebp-18h] BYREF + _BYTE v9[8]; // [esp+Ch] [ebp-10h] BYREF int *obj; // [esp+14h] [ebp-8h] int i; // [esp+18h] [ebp-4h] @@ -489884,7 +489294,7 @@ void __thiscall cStimulator::remap_obj_params(cStimulator *this, const sStimEven 1); if ( *obj == v3 ) { - v4 = (int *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + v4 = (int *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, v9, event->source); @@ -489898,7 +489308,7 @@ void __thiscall cStimulator::remap_obj_params(cStimulator *this, const sStimEven 0); if ( *obj == v5 ) { - v6 = (int *)((int (__stdcall *)(IStimSensors *, char *, unsigned int))this->pSensors->GetSensorElems)( + v6 = (int *)((int (__stdcall *)(IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetSensorElems)( this->pSensors, v8, event->sensor); @@ -489907,8 +489317,6 @@ void __thiscall cStimulator::remap_obj_params(cStimulator *this, const sStimEven } } } -// 6790FE: using guessed type char var_10[8]; -// 6790FE: using guessed type char var_18[8]; //----- (006791C0) -------------------------------------------------------- void _E2_19() @@ -489952,14 +489360,14 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e ILinkManagerInternal *v14; // [esp+2Ch] [ebp-180h] ILinkManagerInternal *v15; // [esp+34h] [ebp-178h] IObjectSystem *v16; // [esp+38h] [ebp-174h] - char v18[8]; // [esp+40h] [ebp-16Ch] BYREF - char v19[8]; // [esp+48h] [ebp-164h] BYREF - char v20[8]; // [esp+50h] [ebp-15Ch] BYREF + _BYTE v18[8]; // [esp+40h] [ebp-16Ch] BYREF + _BYTE v19[8]; // [esp+48h] [ebp-164h] BYREF + _BYTE v20[8]; // [esp+50h] [ebp-15Ch] BYREF cSimpleDListIter v21; // [esp+58h] [ebp-154h] BYREF unsigned int e; // [esp+60h] [ebp-14Ch] BYREF cSimpleDListIter v23; // [esp+64h] [ebp-148h] BYREF - char v24[8]; // [esp+6Ch] [ebp-140h] BYREF - int v25[19]; // [esp+74h] [ebp-138h] BYREF + _BYTE v24[8]; // [esp+6Ch] [ebp-140h] BYREF + sStimSourceDesc v25; // [esp+74h] [ebp-138h] BYREF cAutoIPtr pObjSys; // [esp+C0h] [ebp-ECh] BYREF sObjStimPair pair; // [esp+C4h] [ebp-E8h] const sReactionDesc *desc; // [esp+CCh] [ebp-E0h] @@ -489985,7 +489393,7 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e sensor = event->sensor; qmemcpy(&use_event, event, sizeof(use_event)); this->SpewOn = config_get_raw(aStimulationSpe, 0, 0); - obj = *(_DWORD *)((int (__stdcall *)(IStimSensors *, char *, unsigned int))this->pSensors->GetSensorElems)( + obj = *(_DWORD *)((int (__stdcall *)(IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetSensorElems)( this->pSensors, v24, sensor); @@ -490050,7 +489458,7 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e if ( this->SpewOn ) { desc = this->pReactions->DescribeReaction(this->pReactions, copytron.effect.kind); - tronobj = *(_DWORD *)((int (__thiscall *)(IStimSensors *, IStimSensors *, char *, unsigned int))this->pSensors->GetReceptronElems)( + tronobj = *(_DWORD *)((int (__thiscall *)(IStimSensors *, IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetReceptronElems)( this->pSensors, this->pSensors, v19, @@ -490076,7 +489484,7 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e } else { - v30 = *(_DWORD *)((int (__thiscall *)(IStimSensors *, IStimSensors *, char *, unsigned int))this->pSensors->GetReceptronElems)( + v30 = *(_DWORD *)((int (__thiscall *)(IStimSensors *, IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetReceptronElems)( this->pSensors, this->pSensors, v20, @@ -490096,7 +489504,7 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e { if ( (use_event.flags & 2) != 0 ) { - v6 = (int *)((int (__stdcall *)(IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + v6 = (int *)((int (__stdcall *)(IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, v18, event_src); @@ -490113,22 +489521,17 @@ void __thiscall cStimulator::handle_event(cStimulator *this, const sStimEvent *e } else { - ((void (__thiscall *)(IStimSources *, IStimSources *, unsigned int, int *))this->pSources->DescribeSource)( + ((void (__thiscall *)(IStimSources *, IStimSources *, unsigned int, sStimSourceDesc *))this->pSources->DescribeSource)( this->pSources, this->pSources, event_src, - v25); - if ( !v25[0] ) + &v25); + if ( !v25.propagator ) this->pSources->RemoveSource(this->pSources, event_src); } } cSimpleDList::~cSimpleDList(&tronList); } -// 6791F2: using guessed type char var_140[8]; -// 6791F2: using guessed type char var_15C[8]; -// 6791F2: using guessed type char var_164[8]; -// 6791F2: using guessed type char var_16C[8]; -// 6791F2: using guessed type int var_138[19]; //----- (00679769) -------------------------------------------------------- void __thiscall cStimulator::burn_queue(cStimulator *this, cStimulator::cEventQueue *queue) @@ -490258,13 +489661,13 @@ int __stdcall cStimulator::GetSensitivity(cStimulator *this, unsigned int sensor { int *v3; // eax int v4; // edx - char v6[8]; // [esp+0h] [ebp-18h] BYREF + _BYTE v6[8]; // [esp+0h] [ebp-18h] BYREF const sReceptron *tron; // [esp+8h] [ebp-10h] IReceptronQuery *query; // [esp+Ch] [ebp-Ch] sObjStimPair pair; // [esp+10h] [ebp-8h] memset(sens, 0, sizeof(sStimSensitivity)); - v3 = (int *)((int (__stdcall *)(IStimSensors *, char *, unsigned int))this->pSensors->GetSensorElems)( + v3 = (int *)((int (__stdcall *)(IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetSensorElems)( this->pSensors, v6, sensor); @@ -490288,21 +489691,19 @@ int __stdcall cStimulator::GetSensitivity(cStimulator *this, unsigned int sensor query->Release(query); return 0; } -// 679A5E: using guessed type char var_18[8]; //----- (00679B9D) -------------------------------------------------------- const Position *__stdcall cStimulator::GetSensorPosition(cStimulator *this, unsigned int sensor) { int *v2; // eax - char v4[8]; // [esp+0h] [ebp-Ch] BYREF + _BYTE v4[8]; // [esp+0h] [ebp-Ch] BYREF - v2 = (int *)((int (__stdcall *)(IStimSensors *, char *, unsigned int))this->pSensors->GetSensorElems)( + v2 = (int *)((int (__stdcall *)(IStimSensors *, _BYTE *, unsigned int))this->pSensors->GetSensorElems)( this->pSensors, v4, sensor); return j__ObjPosGet(*v2); } -// 679B9D: using guessed type char var_C[8]; //----- (00679BD4) -------------------------------------------------------- unsigned int __stdcall cStimulator::AddFilter( @@ -490353,13 +489754,13 @@ unsigned int __thiscall cStimulator::scale_filter(cStimulator *this, sStimEvent { int *v2; // eax int v3; // edx - char v6[8]; // [esp+4h] [ebp-14h] BYREF + _BYTE v6[8]; // [esp+4h] [ebp-14h] BYREF sObjStimPair pair; // [esp+Ch] [ebp-Ch] float scale; // [esp+14h] [ebp-4h] BYREF if ( event->source ) { - v2 = (int *)((int (__thiscall *)(IStimSources *, IStimSources *, char *, unsigned int))this->pSources->GetSourceElems)( + v2 = (int *)((int (__thiscall *)(IStimSources *, IStimSources *, _BYTE *, unsigned int))this->pSources->GetSourceElems)( this->pSources, this->pSources, v6, @@ -490373,7 +489774,6 @@ unsigned int __thiscall cStimulator::scale_filter(cStimulator *this, sStimEvent } return 0; } -// 679C8F: using guessed type char var_14[8]; //----- (00679D05) -------------------------------------------------------- void __thiscall cStimulator::init_props(cStimulator *this) @@ -491479,7 +490879,7 @@ void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this) // 994244: using guessed type void *cDataOpsMemFile::`vftable'; //----- (0067BDED) -------------------------------------------------------- -void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this, const void *buf, int len) +void __thiscall cDataOpsMemFile::cDataOpsMemFile(cDataOpsMemFile *this, const void *buf, unsigned int len) { cCTUnaggregated::cCTUnaggregated(this); this->mAllocatedSize = len; @@ -491515,7 +490915,7 @@ size_t __stdcall cDataOpsMemFile::Read(cDataOpsMemFile *this, void *buf, unsigne } //----- (0067BEF2) -------------------------------------------------------- -int __stdcall cDataOpsMemFile::Write(cDataOpsMemFile *this, const void *buf, int len) +size_t __stdcall cDataOpsMemFile::Write(cDataOpsMemFile *this, const void *buf, size_t len) { char *newBuf; // [esp+0h] [ebp-4h] @@ -491585,7 +490985,7 @@ sDatum *__stdcall cFixedSizeDataOps::New(cFixedSizeDataOps *this, sDatum *result //----- (0067C08E) -------------------------------------------------------- sDatum *__stdcall cFixedSizeDataOps::CopyNew(cFixedSizeDataOps *this, sDatum *result, sDatum __$ReturnUdt) { - char v4[4]; // [esp+0h] [ebp-8h] BYREF + _BYTE v4[4]; // [esp+0h] [ebp-8h] BYREF sDatum newval; // [esp+4h] [ebp-4h] BYREF newval.value = this->New(this, v4)->value; @@ -491593,7 +490993,6 @@ sDatum *__stdcall cFixedSizeDataOps::CopyNew(cFixedSizeDataOps *this, sDatum *re result->value = newval.value; return result; } -// 67C08E: using guessed type char var_8[4]; //----- (0067C0CE) -------------------------------------------------------- int __stdcall cFixedSizeDataOps::Delete(cFixedSizeDataOps *this, sDatum val) @@ -491626,7 +491025,7 @@ int __stdcall cFixedSizeDataOps::Version(cFixedSizeDataOps *this) int __stdcall cFixedSizeDataOps::Read(cFixedSizeDataOps *this, sDatum *pdat, IDataOpsFile *file, int version) { int mSize; // [esp+0h] [ebp-18h] - char v6[4]; // [esp+Ch] [ebp-Ch] BYREF + _BYTE v6[4]; // [esp+Ch] [ebp-Ch] BYREF char *buf; // [esp+10h] [ebp-8h] int size; // [esp+14h] [ebp-4h] @@ -491643,7 +491042,6 @@ int __stdcall cFixedSizeDataOps::Read(cFixedSizeDataOps *this, sDatum *pdat, IDa operator delete(buf); return 0; } -// 67C132: using guessed type char var_C[4]; //----- (0067C1DC) -------------------------------------------------------- int __stdcall cFixedSizeDataOps::Write(cFixedSizeDataOps *this, sDatum val, IDataOpsFile *file) @@ -491949,7 +491347,7 @@ int __thiscall LinkArray::Add(LinkArray *this, int source, int dest) int v8; // esi int v9; // edi LinkEnds *v10; // eax - int v11; // [esp+8h] [ebp-2Ch] + BOOL v11; // [esp+8h] [ebp-2Ch] int v13; // [esp+10h] [ebp-24h] LinkEnds v14; // [esp+14h] [ebp-20h] BYREF LinkEnds v15; // [esp+1Ch] [ebp-18h] BYREF @@ -494286,7 +493684,7 @@ void __thiscall cFromObjQueryDatabase::cFromObjQueryDatabase( int sponsor) { LinksByObj *v3; // eax - int v4; // [esp+0h] [ebp-18h] + BOOL v4; // [esp+0h] [ebp-18h] LinksByObj *v5; // [esp+4h] [ebp-14h] LinksByObj *v6; // [esp+8h] [ebp-10h] LinksByObj *v8; // [esp+10h] [ebp-8h] @@ -494417,7 +493815,7 @@ ILinkQuery *__stdcall cFromObjQueryDatabase::QueryComplex( void __thiscall cToObjQueryDatabase::cToObjQueryDatabase(cToObjQueryDatabase *this, LinksByObj *table, int sponsor) { LinksByObj *v3; // eax - int v4; // [esp+0h] [ebp-18h] + BOOL v4; // [esp+0h] [ebp-18h] LinksByObj *v5; // [esp+4h] [ebp-14h] LinksByObj *v6; // [esp+8h] [ebp-10h] LinksByObj *v8; // [esp+10h] [ebp-8h] @@ -495774,9 +495172,9 @@ BOOL __stdcall cLinkManager::RemoveQueryDB(cLinkManager *this, ILinkQueryDatabas } //----- (00683A62) -------------------------------------------------------- -int __cdecl RemoveQDBFromList(ILinkQueryDatabase *db, cDynArray *QueryDBs) +BOOL __cdecl RemoveQDBFromList(ILinkQueryDatabase *db, cDynArray *QueryDBs) { - int remove; // [esp+0h] [ebp-Ch] + BOOL remove; // [esp+0h] [ebp-Ch] LinkQDBEntry *e; // [esp+4h] [ebp-8h] unsigned int i; // [esp+8h] [ebp-4h] @@ -495926,9 +495324,9 @@ cNullRelation *__stdcall cLinkManager::GetRelationNamed(cLinkManager *this, cons { size_t v2; // eax cNullRelation *rel; // [esp+0h] [ebp-8h] - int inverted; // [esp+4h] [ebp-4h] + BOOL inverted; // [esp+4h] [ebp-4h] - for ( inverted = 0; ; inverted = inverted == 0 ) + for ( inverted = 0; ; inverted = !inverted ) { v2 = strlen(prefix_0); if ( strnicmp(prefix_0, name, v2) ) @@ -496250,7 +495648,7 @@ int __stdcall cLinkManager::RemapOnLoad(cLinkManager *this, int id) __int16 rel; // [esp+4h] [ebp-Ch] __int16 rela; // [esp+4h] [ebp-Ch] cLinkManager::cIDMap *map; // [esp+8h] [ebp-8h] - int inverted; // [esp+Ch] [ebp-4h] + BOOL inverted; // [esp+Ch] [ebp-4h] map = &this->idMap[(id >> 16) & 0xF]; rel = (int)(id & 0xFFF00000) / 0x100000; @@ -497984,7 +497382,7 @@ int __userpurge cBaseLinkStore::Save@( cBaseLinkStore *this, __int16 id, IUnknown *fileunk, - int partition) + unsigned int partition) { int v5; // edx int v7; // [esp-4h] [ebp-38h] @@ -498126,7 +497524,7 @@ int __userpurge cBaseLinkStore::Load@( cBaseLinkStore *this, __int16 id, IUnknown *fileunk, - int partition) + unsigned int partition) { int v6; // [esp-8h] [ebp-58h] int v7; // [esp-8h] [ebp-58h] @@ -498292,7 +497690,7 @@ int __userpurge cBaseLinkDataStore::Save@( cBaseLinkDataStore *this, __int16 id, IUnknown *fileunk, - int filetype) + unsigned int filetype) { IDataOps *v5; // eax int v6; // ecx @@ -498427,10 +497825,10 @@ int __userpurge cBaseLinkDataStore::Load@( IDataOpsFile *v12; // [esp+0h] [ebp-64h] IDataOps *v13; // [esp+4h] [ebp-60h] ILinkManagerInternal *v14; // [esp+8h] [ebp-5Ch] - char v15[4]; // [esp+Ch] [ebp-58h] BYREF + _BYTE v15[4]; // [esp+Ch] [ebp-58h] BYREF cDataOpsTagFile *v16; // [esp+10h] [ebp-54h] cFixedSizeDataOps *v17; // [esp+14h] [ebp-50h] - char v18[12]; // [esp+18h] [ebp-4Ch] BYREF + sLink v18; // [esp+18h] [ebp-4Ch] BYREF int i; // [esp+24h] [ebp-40h] int idx; // [esp+28h] [ebp-3Ch] sDatum dat; // [esp+2Ch] [ebp-38h] BYREF @@ -498508,7 +497906,7 @@ int __userpurge cBaseLinkDataStore::Load@( for ( i = 0; i < 3; ++i ) { link = j__LinkRemapOnLoad((unsigned __int16)idx | ((i & 0xF) << 16) | ((id & 0xFFF) << 20)); - if ( rel->Get(rel, link, (sLink *)v18) ) + if ( rel->Get(rel, link, &v18) ) { if ( !this->Get(this, link) ) break; @@ -498543,8 +497941,6 @@ int __userpurge cBaseLinkDataStore::Load@( } // 6889DA: variable 'v5' is possibly undefined // 688A5A: variable 'v8' is possibly undefined -// 6888F3: using guessed type char var_58[4]; -// 6888F3: using guessed type char var_4C[12]; //----- (00688C4C) -------------------------------------------------------- int __userpurge cBaseLinkDataStore::Reset@(int a1@, cBaseLinkDataStore *this, __int16 id) @@ -499824,7 +499220,7 @@ void __thiscall cLinkProperty::Init(cLinkProperty *this, const sRelationDesc *rd sRelationDesc copy_rdesc; // [esp+20h] [ebp-44h] BYREF sCustomRelationDesc custdesc; // [esp+4Ch] [ebp-18h] BYREF - qmemcpy(©_rdesc, rdesc, sizeof(copy_rdesc)); + qmemcpy((void *)©_rdesc, rdesc, sizeof(copy_rdesc)); flags = copy_rdesc.flags; LOBYTE(flags) = LOBYTE(copy_rdesc.flags) | 2; copy_rdesc.flags = flags; @@ -500661,10 +500057,10 @@ int __stdcall cBaseRelation::GetSingleLink(cBaseRelation *this, int source, int // 68CF8A: variable 'v6' is possibly undefined //----- (0068D003) -------------------------------------------------------- -int __stdcall cBaseRelation::AnyLinks(cBaseRelation *this, int source, int dest) +BOOL __stdcall cBaseRelation::AnyLinks(cBaseRelation *this, int source, int dest) { ILinkQuery *pQuery; // [esp+0h] [ebp-8h] - int result; // [esp+4h] [ebp-4h] + BOOL result; // [esp+4h] [ebp-4h] pQuery = this->Query(this, source, dest); result = pQuery->Done(pQuery) == 0; @@ -501006,7 +500402,7 @@ int __stdcall cStandardRelation::Remove(cStandardRelation *this, int id) int v3; // eax ILinkQueryDatabase *v4; // [esp+0h] [ebp-28h] ILinkManagerInternal *v5; // [esp+4h] [ebp-24h] - char v6[8]; // [esp+8h] [ebp-20h] BYREF + _BYTE v6[8]; // [esp+8h] [ebp-20h] BYREF __int16 v7; // [esp+10h] [ebp-18h] int retval; // [esp+14h] [ebp-14h] int i; // [esp+18h] [ebp-10h] @@ -501100,7 +500496,7 @@ ILinkQuery *__userpurge cStandardRelation::Query@(int a1@, cStandardRe } //----- (0068DBCE) -------------------------------------------------------- -int __stdcall cStandardRelation::Notify(cStandardRelation *this, int msg, void *data) +int __stdcall cStandardRelation::Notify(cStandardRelation *this, unsigned int msg, void *data) { int v3; // eax int v4; // eax @@ -501117,7 +500513,7 @@ int __stdcall cStandardRelation::Notify(cStandardRelation *this, int msg, void * unsigned int v16; // [esp+8h] [ebp-24h] int n; // [esp+Ch] [ebp-20h] sLink link; // [esp+10h] [ebp-1Ch] BYREF - int j; // [esp+1Ch] [ebp-10h] + ILinkQuery *j; // [esp+1Ch] [ebp-10h] int i; // [esp+20h] [ebp-Ch] ILinkQuery *q; // [esp+24h] [ebp-8h] uObjNotifyData info; // [esp+28h] [ebp-4h] @@ -501147,20 +500543,21 @@ int __stdcall cStandardRelation::Notify(cStandardRelation *this, int msg, void * else if ( v16 == -2147483644 ) { LOWORD(v3) = this->ID; - for ( j = ((int (__thiscall *)(ILinkStore *, ILinkStore *, int))this->Store->GetAll)(this->Store, this->Store, v3); - !(*(int (__stdcall **)(int))(*(_DWORD *)j + 12))(j); - (*(void (__stdcall **)(int))(*(_DWORD *)j + 28))(j) ) + for ( j = (ILinkQuery *)((int (__thiscall *)(ILinkStore *, ILinkStore *, int))this->Store->GetAll)( + this->Store, + this->Store, + v3); !j->Done(j); j->Next(j) ) { - (*(void (__stdcall **)(int, sLink *))(*(_DWORD *)j + 16))(j, &link); + j->Link(j, &link); for ( n = 0; n < cLinkQueryDatabaseSet::Size(&this->DB); ++n ) { - v13 = (*(int (__stdcall **)(int, sLink *))(*(_DWORD *)j + 20))(j, &link); + v13 = ((int (__stdcall *)(ILinkQuery *, sLink *))j->ID)(j, &link); v14 = cLinkQueryDatabaseSet::operator[](&this->DB, n); ((void (__stdcall *)(ILinkQueryDatabase *, int))v14->Add)(v14, v13); } } if ( j ) - (*(void (__stdcall **)(int))(*(_DWORD *)j + 8))(j); + j->Release(j); j = 0; } } @@ -501239,8 +500636,8 @@ void __thiscall cStandardRelation::SendLinkMsg(cStandardRelation *this, unsigned IObjectSystem *v17; // [esp+8h] [ebp-40h] cAnsiStr v19; // [esp+10h] [ebp-38h] BYREF cAnsiStr v20; // [esp+1Ch] [ebp-2Ch] BYREF - char v21[4]; // [esp+28h] [ebp-20h] BYREF - char v22[4]; // [esp+2Ch] [ebp-1Ch] BYREF + _BYTE v21[4]; // [esp+28h] [ebp-20h] BYREF + _BYTE v22[4]; // [esp+2Ch] [ebp-1Ch] BYREF void *data; // [esp+30h] [ebp-18h] cAutoIPtr pObjectSystem; // [esp+34h] [ebp-14h] BYREF unsigned int msgSize; // [esp+38h] [ebp-10h] @@ -501285,12 +500682,12 @@ void __thiscall cStandardRelation::SendLinkMsg(cStandardRelation *this, unsigned netmsg->handlerID = cStandardRelation::gmNetMsgHandlerID; netmsg->ops = ops; netmsg->relationID = linkdata->flavor; - v5 = (sGlobalObjID *)((int (__stdcall *)(INetManager *, char *, int))cBaseRelation::gmNetMan->ToGlobalObjID)( + v5 = (sGlobalObjID *)((int (__stdcall *)(INetManager *, _BYTE *, int))cBaseRelation::gmNetMan->ToGlobalObjID)( cBaseRelation::gmNetMan, v22, linkdata->source); netmsg->sourceGID = *v5; - v6 = (sGlobalObjID *)((int (__stdcall *)(INetManager *, char *, int))cBaseRelation::gmNetMan->ToGlobalObjID)( + v6 = (sGlobalObjID *)((int (__stdcall *)(INetManager *, _BYTE *, int))cBaseRelation::gmNetMan->ToGlobalObjID)( cBaseRelation::gmNetMan, v21, linkdata->dest); @@ -501330,8 +500727,6 @@ void __thiscall cStandardRelation::SendLinkMsg(cStandardRelation *this, unsigned } // 68E212: variable 'v8' is possibly undefined // 68E231: variable 'v10' is possibly undefined -// 68DEF9: using guessed type char var_1C[4]; -// 68DEF9: using guessed type char var_20[4]; //----- (0068E292) -------------------------------------------------------- void __cdecl cStandardRelation::ReceiveLinkMsg(sLinkNetMsg *pMsg, unsigned int size, int from) @@ -501686,8 +501081,8 @@ void __thiscall cBaseRelation::cBaseRelation( ILinkManagerInternal *v3; // [esp+8h] [ebp-8h] cUnknownRelation::cUnknownRelation(this); - qmemcpy(&this->Desc, desc, sizeof(this->Desc)); - qmemcpy(&this->DataDesc, datadesc, sizeof(this->DataDesc)); + qmemcpy((void *)&this->Desc, desc, sizeof(this->Desc)); + qmemcpy((void *)&this->DataDesc, datadesc, sizeof(this->DataDesc)); cDynArray::cDynArray(&this->Listeners); this->__vftable = (cBaseRelation_vtbl *)&cBaseRelation::`vftable'; v3 = cLinkManagerKnower::LinkMan(); @@ -501964,7 +501359,7 @@ void __thiscall cInverseRelation::cInverseRelation(cInverseRelation *this, IRela this->__vftable = (cInverseRelation_vtbl *)&cInverseRelation::`vftable'; rel->AddRef(rel); desc = rel->Describe(rel); - qmemcpy(&this->Desc, desc, sizeof(this->Desc)); + qmemcpy((void *)&this->Desc, desc, sizeof(this->Desc)); strcpy(this->Desc.name, asc_A1C7DC); v2 = strlen(this->Desc.name); strncat(this->Desc.name, desc->name, 32 - v2 - 1); @@ -502750,7 +502145,7 @@ int __thiscall cStoredProperty::QI(cStoredProperty *this, IUnknown *me, const _G //----- (0069121F) -------------------------------------------------------- void __thiscall cPropertyBase::cPropertyBase(cPropertyBase *this, const sPropertyDesc *desc) { - qmemcpy(&this->mDesc, desc, sizeof(this->mDesc)); + qmemcpy((void *)&this->mDesc, desc, sizeof(this->mDesc)); cDynArray::cDynArray(&this->mListeners); this->mpImplied = 0; this->mpRequired = 0; @@ -503051,8 +502446,8 @@ void __thiscall cStoredProperty::CallListeners( int __thiscall cStoredProperty::Create(cStoredProperty *this, int obj) { int v3; // eax - char v5[4]; // [esp+8h] [ebp-1Ch] BYREF - char v6[4]; // [esp+Ch] [ebp-18h] BYREF + _BYTE v5[4]; // [esp+8h] [ebp-1Ch] BYREF + _BYTE v6[4]; // [esp+Ch] [ebp-18h] BYREF int msg; // [esp+14h] [ebp-10h] cPropAutoBlamer blamer__; // [esp+18h] [ebp-Ch] BYREF int example; // [esp+1Ch] [ebp-8h] @@ -503090,14 +502485,12 @@ int __thiscall cStoredProperty::Create(cStoredProperty *this, int obj) } } // 40622B: using guessed type int j__PropPopBlame(void); -// 691A08: using guessed type char var_18[4]; -// 691A08: using guessed type char var_1C[4]; //----- (00691B23) -------------------------------------------------------- int __thiscall cStoredProperty::Copy(cStoredProperty *this, int targ, int src) { - char v5[4]; // [esp+4h] [ebp-14h] BYREF - char v6[4]; // [esp+8h] [ebp-10h] BYREF + _BYTE v5[4]; // [esp+4h] [ebp-14h] BYREF + _BYTE v6[4]; // [esp+8h] [ebp-10h] BYREF sDatum dat; // [esp+Ch] [ebp-Ch] BYREF unsigned int msg; // [esp+10h] [ebp-8h] sDatum srcval; // [esp+14h] [ebp-4h] BYREF @@ -503128,8 +502521,6 @@ int __thiscall cStoredProperty::Copy(cStoredProperty *this, int targ, int src) return 0; } // 40622B: using guessed type int j__PropPopBlame(void); -// 691B23: using guessed type char var_10[4]; -// 691B23: using guessed type char var_14[4]; //----- (00691C2F) -------------------------------------------------------- int __thiscall cStoredProperty::Set(cStoredProperty *this, int obj, sDatum value) @@ -503278,10 +502669,10 @@ void __thiscall cStoredProperty::InitTraits(cStoredProperty *this) sTraitDesc tdesc; // [esp+18h] [ebp-28h] BYREF cAutoIPtr pTraitMan; // [esp+3Ch] [ebp-4h] BYREF - memset(&tdesc, 0, sizeof(tdesc)); + memset((void *)&tdesc, 0, sizeof(tdesc)); strncpy(tdesc.name, this->mDesc.name, 0x10u); tdesc.name[31] = 0; - pred.func = PropTraitPred; + pred.func = (int (__cdecl *)(int, void *))PropTraitPred; pred.data = this; Aggregated = (ITraitManager *)_AppGetAggregated(&IID_ITraitManager); cAutoIPtr::cAutoIPtr(&pTraitMan, Aggregated); @@ -503825,8 +503216,8 @@ int __stdcall cStoredPropertyNetworking::SendPropertyMsg( IDataOps *ops; // [esp+4h] [ebp-2Ch] cStoredPropertyNetworking::sPropertyNetMsg *msg; // [esp+8h] [ebp-28h] int toHostPlayer; // [esp+Ch] [ebp-24h] - int valSize; // [esp+10h] [ebp-20h] - int msgSize; // [esp+14h] [ebp-1Ch] + size_t valSize; // [esp+10h] [ebp-20h] + unsigned int msgSize; // [esp+14h] [ebp-1Ch] cDataOpsMemFile memFile; // [esp+18h] [ebp-18h] BYREF if ( this->mbHandlingMessage ) @@ -503944,7 +503335,7 @@ void __stdcall cStoredPropertyNetworking::ReceivePropertyMsg( int v6; // eax IObjectSystem *v7; // [esp+0h] [ebp-40h] int netObjID; // [esp+4h] [ebp-3Ch] - char v9[4]; // [esp+8h] [ebp-38h] BYREF + _BYTE v9[4]; // [esp+8h] [ebp-38h] BYREF cDataOpsMemFile memFile; // [esp+Ch] [ebp-34h] BYREF sDatum value; // [esp+24h] [ebp-1Ch] BYREF unsigned int headerSize; // [esp+28h] [ebp-18h] @@ -504034,7 +503425,6 @@ void __stdcall cStoredPropertyNetworking::ReceivePropertyMsg( mprintf("Got property %d:%s message from unknown player.\n", msg->netObjID, this->mpProp->mDesc.name); } } -// 693810: using guessed type char var_38[4]; //----- (00693BC0) -------------------------------------------------------- cStoredPropertyNetworking *__thiscall cStoredPropertyNetworking::`vector deleting destructor'( @@ -504812,30 +504202,30 @@ IVectorProperty *__cdecl CreateVectorPropertyFromStore(const sPropertyDesc *desc int PropertyInterfacesInit() { int result; // eax - IUnknown *v1; // [esp+0h] [ebp-14h] - IUnknown *v2; // [esp+4h] [ebp-10h] - IUnknown *v3; // [esp+8h] [ebp-Ch] - IUnknown *Aggregated; // [esp+Ch] [ebp-8h] + IStructDescTools *v1; // [esp+0h] [ebp-14h] + IStructDescTools *v2; // [esp+4h] [ebp-10h] + IStructDescTools *v3; // [esp+8h] [ebp-Ch] + IStructDescTools *Aggregated; // [esp+Ch] [ebp-8h] IStructDescTools *tools; // [esp+10h] [ebp-4h] tools = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); tools->Register(tools, &booldesc); if ( tools ) tools->Release(tools); - Aggregated = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))Aggregated->__vftable[5].QueryInterface)(Aggregated, &intdesc); + Aggregated = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + Aggregated->Register(Aggregated, &intdesc); if ( Aggregated ) Aggregated->Release(Aggregated); - v3 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v3->__vftable[5].QueryInterface)(v3, &floatdesc); + v3 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v3->Register(v3, &floatdesc); if ( v3 ) v3->Release(v3); - v2 = _AppGetAggregated(&IID_IStructDescTools); - ((void (__stdcall *)(IUnknown *, sStructDesc *))v2->__vftable[5].QueryInterface)(v2, &labeldesc); + v2 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + v2->Register(v2, &labeldesc); if ( v2 ) v2->Release(v2); - v1 = _AppGetAggregated(&IID_IStructDescTools); - result = ((int (__stdcall *)(IUnknown *, sStructDesc *))v1->__vftable[5].QueryInterface)(v1, &vecdesc); + v1 = (IStructDescTools *)_AppGetAggregated(&IID_IStructDescTools); + result = v1->Register(v1, &vecdesc); if ( v1 ) return v1->Release(v1); return result; @@ -504873,7 +504263,7 @@ void __thiscall cIntegralProperty::cIntegralProperty( unsigned int impl) { cGenericIntProperty::cGenericIntProperty(this, desc, impl); - qmemcpy(&this->TypeDesc, tdesc, sizeof(this->TypeDesc)); + qmemcpy((void *)&this->TypeDesc, tdesc, sizeof(this->TypeDesc)); this->cGenericIntProperty::cGenericProperty::cProperty::cUnknownProperty::cCTUnaggregated::IIntProperty::IProperty::IUnknown::__vftable = (cIntegralProperty_vtbl *)&cIntegralProperty::`vftable'{for `cUnknownProperty'}; this->cGenericIntProperty::cGenericProperty::cProperty::cStoredProperty::cPropertyBase::__vftable = (cStoredProperty_vtbl *)&cIntegralProperty::`vftable'{for `cStoredProperty'}; } @@ -504909,7 +504299,7 @@ void __thiscall cIntegralProperty::cIntegralProperty( IPropertyStore *impl) { cGenericIntProperty::cGenericIntProperty(this, desc, impl); - qmemcpy(&this->TypeDesc, tdesc, sizeof(this->TypeDesc)); + qmemcpy((void *)&this->TypeDesc, tdesc, sizeof(this->TypeDesc)); this->cGenericIntProperty::cGenericProperty::cProperty::cUnknownProperty::cCTUnaggregated::IIntProperty::IProperty::IUnknown::__vftable = (cIntegralProperty_vtbl *)&cIntegralProperty::`vftable'{for `cUnknownProperty'}; this->cGenericIntProperty::cGenericProperty::cProperty::cStoredProperty::cPropertyBase::__vftable = (cStoredProperty_vtbl *)&cIntegralProperty::`vftable'{for `cStoredProperty'}; } @@ -505522,7 +504912,7 @@ int __stdcall cClassDataOps