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

Restructure + Build-Time Reduction #7

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
664c562
added glue so the code can be compiled
Apr 10, 2023
eefa88d
cleaned Makefile
Apr 10, 2023
b379e6a
Update Makefile
weigert Apr 10, 2023
fdc3faa
reformatted glue.cpp, fixed Makefile for amd/x86 on ubuntu, required …
weigert Apr 10, 2023
5daba0b
added glue so the code can be compiled
Apr 10, 2023
6005bf1
cleaned Makefile
Apr 10, 2023
9112999
Update Makefile
weigert Apr 10, 2023
62fbfa0
reformatted glue.cpp, fixed Makefile for amd/x86 on ubuntu, required …
weigert Apr 10, 2023
5a00f9e
Merge branch 'glue' of github.com:weigert/Dwarf-Fortress--libgraphics…
Jul 6, 2023
fa6b0f9
Compilable restructure, which moves files to where they roughly appea…
Jul 6, 2023
02e2288
first re-indentation pass
Jul 6, 2023
75034e3
more cleanup, separated out a lot of commonly used structs for better…
Jul 6, 2023
c3e7436
more cleanup for the files and files compressor
Jul 6, 2023
515008c
further dependency reduction
Jul 6, 2023
8477eb0
more cleanup, dependency reduction, include guards
Jul 6, 2023
c3f27d5
cleaned up find_files
Jul 6, 2023
87567ea
extracting more things from the large rendering files into separate t…
Jul 6, 2023
9f39536
slowly extracting graphics components
Jul 6, 2023
c3d5301
separated out more translation units, including text transformation f…
Jul 6, 2023
bcd1ef5
preliminary music_and_sound cleanup
Jul 6, 2023
e00f49b
moved the graphics files around again, awaiting future separation
Jul 6, 2023
a150e5f
made all include guards consitent
Jul 6, 2023
c0ae0b4
more minor tweaks
Jul 6, 2023
711f218
Added .clang-format based on LLVM style with some minor adjustments, …
Jul 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# DwarfFortress clang-format code style rules
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# In-Place Usage:
# find g_src/ -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i -style=file

Language: Cpp
BasedOnStyle: LLVM

IndentWidth: 2
TabWidth: 2
UseTab: Never

DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Left

EmptyLineBeforeAccessModifier: Always

AlignTrailingComments:
Kind: Always
OverEmptyLines: 1

SeparateDefinitionBlocks: Always
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tmp/**
main
*.dSYM/**
gamelog.txt
errorlog.txt
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Dwarf-Fortress Libgraphics Makefile
# Tested on MacOSX (M1, arm) GNU/Linux (Ubuntu, x86 amd)

# Install Location Configuration
INCPATH = -I/usr/local/include
LIBPATH = -L/usr/local/lib
LINKOS = -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lz -ldl -lpthread

# Compilation Settings
CC = g++-11 -std=c++20
CF = -Wfatal-errors -O3 -g -DDF_GLUE_CPP

UNAME := $(shell uname)
ifeq ($(UNAME), Linux) #Detect GNU/Linux
endif
ifeq ($(UNAME), Darwin) #Detect MacOS
# assume dependency installation w. homebrew
INCPATH = -I/opt/homebrew/include
LIBPATH = -L/opt/homebrew/lib
CC = g++-12 -std=c++20
endif

.PHONY: all
all:
@echo "Compiling Dwarf-Fortress libgraphics (main)...";
@$(CC) $(CF) $(INCPATH) $(LIBPATH) \
g_src/platform/win32_compat.cpp \
g_src/util/definitions.cpp \
g_src/util/command_line.cpp \
g_src/util/random.cpp \
g_src/util/logger.cpp \
g_src/text/stringvec.cpp \
g_src/text/textlines.cpp \
g_src/text/transform.cpp \
g_src/files/files.cpp \
g_src/files/file_compressor.cpp \
g_src/files/find_files_posix.cpp \
g_src/files/find_files_windows.cpp \
g_src/audio/audio.cpp \
g_src/audio/audio_fmod.cpp \
g_src/audio/audio_sdl.cpp \
g_src/graphics/enabler.cpp \
g_src/graphics/enabler_input.cpp \
g_src/graphics/graphics.cpp \
g_src/graphics/init.cpp \
g_src/graphics/interface.cpp \
g_src/graphics/keybindings.cpp \
g_src/graphics/KeybindingScreen.cpp \
g_src/graphics/renderer_offscreen.cpp \
g_src/graphics/resize++.cpp \
g_src/graphics/textures.cpp \
g_src/graphics/ViewBase.cpp \
g_src/hooks/dfhooks.cpp \
glue/glue.cpp \
$(LINKOS) -o main
@echo "Done";
Loading