Code Monkey home page Code Monkey logo

open1560's People

Contributors

0x1f9f1 avatar kcrobin9 avatar sharkwouter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open1560's Issues

Broken police cruiser dashboard texture

The paletted version of the ford mustang cruiser's dashboard texture is "corrupt". This is likely because it uses the same "cop" palette as the ford mustang fastback.
image

Fix input issues

  • Inputs are sometimes captured even when the game is not focused.
  • Sometimes keys will get stuck down when using with ALT (most likely due to not handling WM_SYSKEYDOWN/WM_SYSKEYUP).

Understand pager address checks

agiMeshSet and mmBoundTemplate contain asserts (unsigned)M > 0x01000000 and (unsigned)this > 0x01000000 It is unclear what these asserts are for, or if they are actually required.

Support file mapping

The game has support for file mapping, but FileStream does not currently support it.

Fix 32 bit rendering

Using -depth 32 currently crashes due to some stuff being hardcoded for 16-bit

Use SEH handlers where required

The following functions use SEH (__try, __except) handlers:

GameLoop(mmInterface *,mmGameManager *,char *)
Application(int,char * *)
aiMap::Reset(void)
aiMap::Update(void)
aiPath::UpdateAmbients(void)
aiPath::UpdatePedestrians(void)
aiVehiclePolice::Reset(void)
DoStackTraceback(int,int *)
LogStackTraceback(int *,int)
swScanSurfaces(void)
dxiMemoryAllocate(IDirectDrawSurface4 * *,uint)
ipcMessageQueue::MessageLoop(void)
initHaveMMX::initHaveMMX(void)
utimer(void)
__ComputeCpuSpeed(void)

Increase Debug Font Size

The debug font uses 8x8 bitmaps for each character, which can be difficult to read on larger resolutions.

Fix thread-safety

Now that we are no longer pinning the game to 1 core with SetProcessAffinityMask, we may find some thread-safety issues.

Bad destruction order in mmGame::~mmGame

mmGame::~mmGame calls aiMap::Clean after deleting this->CullCity (mmCullCity::~mmCullCity).
This is a problem as mmCullCity controls the mmInstance heap and frees it the destructor, but aiMap still contains lists of aiVehicleAmbient and aiVehiclePolice.
These classes inherit from aiVehicleSpline, which contains a pointer to an aiVehicleInstance (offset 0xB4), which inherits from mmInstance, and so is allocated on the mmInstance heap.
When aiMap::Clean attempts to free the ambients and police, they end up trying to free the aiVehicleInstance pointer in aiVehicleSpline::~aiVehicleSpline, but that memory has already been freed as part of the instance heap.

agiBitmap Surface Leak

agiBitmap leaks its agiSurfaceDesc, and also its agiSurfaceDesc::lpSurface if the texture is temp (starst with *)

Fix cop chase speed

Cop chase speed is partically tied to framerate, which can make them very OP at higher framerates.

Fix MultiTexture support

Although AGI appears to support multi-texturing, support has been removed in a few places:
NoMultiTexture is always set to 1.
agiCurState.MaxTextures is always set to 1.

agiD3DPipeline::BeginGfx:

// test1560.exe

NoMultiTexture = 1;
if (hwcaps.dwDevCaps & 0x4000) {
    agiDisplayf("Separate texture memories (probably a voodoo!)");
    NoMultiTexture = 1;
}
agiCurState.State.MaxTextures = 1;
SeparateTextureMemories = 0;

// am.exe

NoMultiTexture = 1;
if (hwcaps.dwDevCaps & 0x4000) {
    agiDisplayf("Separate texture memories (probably a voodoo!)");
    SeparateTextureMemories = 1;
    NoMultiTexture = 1;
}
if (NoMultiTexture)
    agiRendState::SetMaxTextures(&agiCurState, 1);
else
    agiRendState::SetMaxTextures(&agiCurState, hwcaps.wMaxSimultaneousTextures);
if (agiRendState::GetMaxTextures((char*)&agiCurState) <= 1) {
    SeparateTextureMemories = 0;
} else {
    agiDisplayf("Multitexturing is supported!");
    v41 = v49->D3DDevice->lpVtbl->SetTextureStageState(v49->D3DDevice, 1, D3DTSS_TEXCOORDINDEX, 1);
    __DDTry(
        v41,
        (int)"D3DDevice->SetTextureStageState(1,D3DTSS_TEXCOORDINDEX,1)",
        (int)"C:\\mm\\src\\agid3d\\d3dpipe.c",
        583);
}

agiD3DTexDef::BeginGfx:

// am.exe

multi_texture = 0;

// ...
if (multi_texture
    && agiRendState::GetMaxTextures(&agiCurState) > 1
    && !strncmp(this->Params.Name, "SHADMAP", 7u)) {
    Displayf("Fixing shadow map '%s' for multitexturing...", this->Params.Name);
    surface = (uint16_t*)this->Surface->lpSurface;
    surface_bytes = 0;
    v19 = this->Surface->dwWidth;
    for (i = this->Surface->dwHeight; v19 && i; i >>= 1) {
        surface_bytes += i * v19;
        v19 >>= 1;
    }
    while (surface_bytes--) {
        *surface = ~(((signed int)*surface >> 12) | ((signed int)*surface >> 8) | ((signed int)*surface >> 4));
        ++surface;
    }
}
// ...

Add ZIP support

Add support for ZIP archives to allow easier modding and larger files (ARES cannot handle individula files > 0x7fffff bytes)

Fix mmNumber/mmNumberFont

When using win32 font rendering (but not freetype for some reason), number fonts disappear when after tabbing in. This issue is not present in the retail build, as mmNumber and mmNumberFont were rewritten.

mmLoader - add .Camera as a child

mmLoader contains an asCamera, however it doesn't add this camera as a child. This causes asNode::VerifyTree to fail when running with -updatedbg (DebugMemory & 4)

Add mods folder support

Add support for a mods folder, which allows overwriting files without putting them in an archive.

List::Clear memory leak

This function is inlined (and maybe have just been foo = List()), but in aiVehiclePolice::Reset and aiVehicleOpponent::Reset the existing list is just simply zeroed instead of properly freeing the existing entries.

Improve mmTextNode memory usage

At larger resolutions, mmTextNode can use a lot of memory (~35 MB ingame at 1440p), as all the surfaces are allocated during mmTextNode::Init (via agiBitmap::Init).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.