Git Product home page Git Product logo

Comments (3)

kolen avatar kolen commented on May 30, 2024

On my system (Mac OS 10.13.6, although probably not specific to Mac OS) it segfaults when trying to output "Couldn't load pics/colormap.pcx" fatal error.

Sys_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");

Sys_Error does not have additional argument before formating string:

void Sys_Error(char *error, ...)

Maybe Com_Error should be here? However, it's the same in original code:

https://github.com/id-Software/Quake-2/blob/372afde46e7defc9dd2d719a1732b8ace1fa096e/ref_soft/r_main.c#L1329
https://github.com/id-Software/Quake-2/blob/372afde46e7defc9dd2d719a1732b8ace1fa096e/linux/sys_linux.c#L86

Stack trace:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00007fff56c8d652 libsystem_c.dylib`__vfprintf + 15928
    frame #1: 0x00007fff56cb2059 libsystem_c.dylib`__v2printf + 473
    frame #2: 0x00007fff56c9734b libsystem_c.dylib`_vsnprintf + 415
    frame #3: 0x00007fff56c973fe libsystem_c.dylib`vsnprintf + 80
    frame #4: 0x0000000100006bb7 client`Sys_Error + 471
    frame #5: 0x0000000100065fbb client`Draw_GetPalette + 75
    frame #6: 0x0000000100065f36 client`RE_Init + 118
    frame #7: 0x0000000100003bdd client`VID_LoadRefresh + 13
    frame #8: 0x0000000100003bb8 client`VID_CheckChanges + 72
    frame #9: 0x0000000100003ca3 client`VID_Init + 115
    frame #10: 0x000000010001d633 client`CL_Init + 67
    frame #11: 0x000000010004785d client`Qcommon_Init + 717
    frame #12: 0x00000001000040e6 client`main + 294
    frame #13: 0x00007fff56bf6015 libdyld.dylib`start + 1

Replacing it with Com_Error makes it exit correctly:

diff --git a/src/client/renderer/sw_main.c b/src/client/renderer/sw_main.c
index 91280e4..f5b1066 100644
--- a/src/client/renderer/sw_main.c
+++ b/src/client/renderer/sw_main.c
@@ -1241,7 +1241,7 @@ void Draw_GetPalette(void)
   // get the palette and colormap
   LoadPCX("pics/colormap.pcx", &vid_colormap, &pal, NULL, NULL);
   if (!vid_colormap)
-    Sys_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
+    Com_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
   vid_alphamap = vid_colormap + 64 * 256;

   out = (byte *) d_8to24table;
% ./client

qengine v0.1.0
==============

Byte ordering: little endian

Using '/Users/kolen/items/qengine/build/.//assets' for writing.
couldn't exec default.cfg
couldn't exec config.cfg
couldn't exec autoexec.cfg
Console initialized.
Sound init
Starting SDL audio callback.
SDL audio driver is "coreaudio".
SDL audio initialized.
Sound sampling rate: 44100
==== ShutdownGame ====
Closing SDL audio device...
SDL audio device shut down.
Cmd_RemoveCommand: force_centerview not added
Cmd_RemoveCommand: +mlook not added
Cmd_RemoveCommand: -mlook not added
Shutting down input.
recursive shutdown
Error: Couldn't load pics/colormap.pcx

from qengine.

charlesalec avatar charlesalec commented on May 30, 2024

Hello, thank you for your observation - indeed that does correct the issue. However, I still can't seem to get it to run correctly

from qengine.

klaussilveira avatar klaussilveira commented on May 30, 2024

With this commit, you'll be able to run the engine without the Q2 retail assets: 25c6b2e

These tools can be quite handy once you start creating the assets for your game: https://github.com/klaussilveira/qengine/tree/master/src/tools/assetgen

from qengine.

Related Issues (8)

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.