Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cplusplus #13

Closed
wants to merge 15 commits into from
Closed

Cplusplus #13

wants to merge 15 commits into from

Conversation

wtfbbqhax
Copy link
Member

This change converts the core engine to C++.

Additional work adds Lua interfaces to key bindings

Additional bug fixes ported from ioq3

@wtfbbqhax wtfbbqhax force-pushed the cplusplus branch 2 times, most recently from 594994f to 79f030b Compare March 14, 2017 01:57
wtfbbqhax and others added 15 commits March 15, 2017 17:47
    Client and Server are fully converted to C++

    SDL implementation was converted, requiring additional changes to
    build Renderercommon

    BGame code was modified to prevent name clashes with builtin name
    "class" in C++. (These parts of BGame should be broken away from
    the server code).

    Some files under qcommon can not be converted due to shared usage
    with game logic (e.g., q_shared.c)
    apparently WIN32 doesn't work when compiling as C++. Must use
    _WIN32.

    There seems to be alot of cases of mixed WIN32, _WIN32 and __WIN32__
    and should be fixed.
Given an array b[] of length n, pointers to &b[0]..&b[n] are defined
(where only &b[0]..&b[n-1] can be validly dereferenced). &b[-1], or
equivalently b-1, is not something we can use in valid Standard C.

gcc 6 diagnoses this as:

code/client/snd_wavelet.c:33:9: warning: array subscript is below array
bounds [-Warray-bounds]

and might take this undefined behaviour as permission to emit
"more efficient" object code that is not what the author expected,
for example nothing at all. Use a macro to fake a 1-based array instead.
    Modernize struct declarations

    Use `bool` as datatype instead of `qboolean`

    bg_public.h is no longer a dependency for the server
    Cleaned up client.h

    Replace many instances of qboolean with bool
    Key bindings lua interface

    Cmd execute interface

    Added example lua binds configuration
Prefer pure memset/memcpy vs Com_Memset/Com_Memcpy
Remove unused file module.hpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants