Compare commits
12 Commits
ba99a9a308
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fe9c4d5cb | |||
| beec9bff69 | |||
| eb16ec68a9 | |||
| 35a493cfa3 | |||
| a8def84fc9 | |||
| 9481d94c98 | |||
| 6e97ea92a7 | |||
| 565d3f9aa5 | |||
| 9e7dae60be | |||
| 75eac05e2e | |||
| 6ebe079d62 | |||
| c295e25d26 |
@@ -40,6 +40,9 @@ GLEW, GLU, freetype2, libvorbisfile, libvorbis, libogg, libopenal, libbz2,
|
||||
libXRandR, and libcurl.
|
||||
|
||||
|
||||
sudo apt install libglew-dev libogg-dev libopenal-dev libvorbis-dev zlib1g-dev libfreetype-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev libglew-dev
|
||||
|
||||
|
||||
## Differences with Commercial Version
|
||||
* The music is not part of the open source release of Star Ruler 2. The data/music/ directory from the commercial
|
||||
release can be copied directly into the data/ directory of an open-source build. The music will be detected and played.
|
||||
|
||||
Regular → Executable
+1
-1
@@ -1,5 +1,5 @@
|
||||
=== BLIND MIND STUDIOS ===
|
||||
Andrew Ackermann
|
||||
Amy Ackermann
|
||||
James Woodall
|
||||
|
||||
=== GLACICLE ===
|
||||
|
||||
@@ -341,7 +341,7 @@ COND_ANCIENT_RUINS_DESC: <<|
|
||||
>>
|
||||
BLD_ANCIENT_RUINS: Ancient Ruins
|
||||
BLD_ANCIENT_RUINS_DESC: <<|
|
||||
The ancient ruins of a military outpost constructed by an advanced race eons ago.
|
||||
The ancient ruins of a military outpost constructed by an advanced race eons ago. When first colonized, gain a number of free research points.
|
||||
>>
|
||||
|
||||
COND_HIGH_YIELD: High Yield Resource
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
@@ -824,7 +824,7 @@ Design::Design(SaveFile& file) : initialized(true), data(nullptr), clientData(nu
|
||||
|
||||
unsigned hexesCount = file;
|
||||
hexes.resize(hexesCount);
|
||||
file.read(&hexes.front(), sizeof(vec2u) * hexesCount);
|
||||
file.read(hexes.data(), sizeof(vec2u) * hexesCount);
|
||||
|
||||
cropMin = vec2u(grid.width, grid.height);
|
||||
cropMax = vec2u(0, 0);
|
||||
@@ -948,7 +948,7 @@ void Design::save(SaveFile& file) const {
|
||||
file.write(hexStatusIndex.data, sizeof(int) * hexStatusIndex.width * hexStatusIndex.height);
|
||||
|
||||
file << (unsigned)hexes.size();
|
||||
file.write(&hexes.front(), sizeof(vec2u) * (unsigned)hexes.size());
|
||||
file.write(hexes.data(), sizeof(vec2u) * (unsigned)hexes.size());
|
||||
|
||||
unsigned cnt = getShipVariableCount();
|
||||
file << cnt;
|
||||
|
||||
@@ -3646,7 +3646,7 @@ void Subsystem::init(SaveFile& file) {
|
||||
|
||||
unsigned hexCount = file;
|
||||
hexes.resize(hexCount);
|
||||
file.read(&hexes.front(), hexes.size() * sizeof(vec2u));
|
||||
file.read(hexes.data(), hexes.size() * sizeof(vec2u));
|
||||
hexEffects.resize(hexCount);
|
||||
|
||||
if(file >= SFV_0010) {
|
||||
@@ -3799,7 +3799,7 @@ void Subsystem::save(SaveFile& file) const {
|
||||
file << dataOffset;
|
||||
|
||||
file << unsigned(hexes.size());
|
||||
file.write(&hexes.front(), hexes.size() * sizeof(vec2u));
|
||||
file.write(hexes.data(), hexes.size() * sizeof(vec2u));
|
||||
|
||||
for(unsigned i = 0; i < hexes.size(); ++i) {
|
||||
file << (unsigned)hexEffects[i].size();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#endif
|
||||
|
||||
const unsigned ObjectTypeBitOffset = 26;
|
||||
const unsigned ObjectTypeMask = (unsigned)(0xFF << ObjectTypeBitOffset);
|
||||
const unsigned ObjectTypeMask = 0xFFU << ObjectTypeBitOffset;
|
||||
const unsigned ObjectIDMask = 0xFFFFFFFF >> (32 - ObjectTypeBitOffset);
|
||||
extern unsigned ObjectTypeCount;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void loadBinaryMesh(const char* filename, Mesh& mesh) {
|
||||
return;
|
||||
|
||||
vertices.resize(count);
|
||||
file.read((char*)&vertices.front(), sizeof(vec3f) * count);
|
||||
file.read((char*)vertices.data(), sizeof(vec3f) * count);
|
||||
|
||||
//Normals
|
||||
file.read((char*)&count, sizeof(count));
|
||||
@@ -100,7 +100,7 @@ void loadBinaryMesh(const char* filename, Mesh& mesh) {
|
||||
return;
|
||||
|
||||
normals.resize(count);
|
||||
file.read((char*)&normals.front(), sizeof(vec3f) * count);
|
||||
file.read((char*)normals.data(), sizeof(vec3f) * count);
|
||||
|
||||
//UVs
|
||||
file.read((char*)&count, sizeof(count));
|
||||
@@ -108,7 +108,7 @@ void loadBinaryMesh(const char* filename, Mesh& mesh) {
|
||||
return;
|
||||
|
||||
uvs.resize(count);
|
||||
file.read((char*)&uvs.front(), sizeof(UV) * count);
|
||||
file.read((char*)uvs.data(), sizeof(UV) * count);
|
||||
|
||||
//Faces
|
||||
file.read((char*)&count, sizeof(count));
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace render {
|
||||
bufferFlushes += 1;
|
||||
vbFlushCounts[reason] += 1;
|
||||
|
||||
RenderStep* pSteps = &steps.front();
|
||||
RenderStep* pSteps = steps.data();
|
||||
for(unsigned i = 0, cnt = (unsigned)steps.size(); i < cnt; ++i) {
|
||||
auto& step = pSteps[i];
|
||||
shaderUniforms = step.shaderCache;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
project(GLFW C)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required(VERSION 4.0.0)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(GLFW_VERSION_MAJOR "3")
|
||||
set(GLFW_VERSION_MINOR "0")
|
||||
|
||||
@@ -231,9 +231,8 @@ static void updateKeyCodeLUT(void)
|
||||
// keyboard layout
|
||||
|
||||
// Get keyboard description
|
||||
descr = XkbGetKeyboard(_glfw.x11.display,
|
||||
XkbAllComponentsMask,
|
||||
XkbUseCoreKbd);
|
||||
descr = XkbGetMap(_glfw.x11.display, 0, XkbUseCoreKbd);
|
||||
XkbGetNames(_glfw.x11.display, XkbKeyNamesMask, descr);
|
||||
|
||||
// Find the X11 key code -> GLFW key code mapping
|
||||
for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode)
|
||||
@@ -304,8 +303,8 @@ static void updateKeyCodeLUT(void)
|
||||
}
|
||||
|
||||
// Free the keyboard description
|
||||
XkbFreeKeyboard(descr, 0, True);
|
||||
|
||||
XkbFreeNames(descr, XkbKeyNamesMask, True);
|
||||
XkbFreeClientMap(descr, 0, True);
|
||||
// Translate the un-translated key codes using traditional X11 KeySym
|
||||
// lookups
|
||||
for (keyCode = 0; keyCode < 256; keyCode++)
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
@@ -13,6 +13,9 @@ else
|
||||
OSNAME = lin
|
||||
endif
|
||||
|
||||
CXXFLAGS += -fPIC
|
||||
LDFLAGS += -lGLEW -lGL -lX11 -lXrandr -lfreetype -lz -lm
|
||||
|
||||
ifdef DEBUG
|
||||
BINDIR = bin_d/$(OSNAME)$(ARCH)
|
||||
OBJDIR = obj_d/$(OSNAME)$(ARCH)
|
||||
@@ -36,12 +39,12 @@ else
|
||||
endif
|
||||
ifndef NLTO
|
||||
ifeq (,$(findstring g++, $(CC)))
|
||||
CXXFLAGS += -flto=6
|
||||
#CXXFLAGS += -flto=6
|
||||
else
|
||||
CXXFLAGS += -flto=thin
|
||||
#CXXFLAGS += -flto=thin
|
||||
endif
|
||||
else
|
||||
CXXFLAGS += -fno-lto
|
||||
#CXXFLAGS += -fno-lto
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -55,7 +58,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
ARCHFLAGS = -m64 -march=athlon64 -mtune=generic
|
||||
CXXFLAGS += $(ARCHFLAGS)
|
||||
|
||||
#Angelscript
|
||||
@@ -105,7 +107,7 @@ ifeq ($(UNAME), Darwin)
|
||||
|
||||
CXXFLAGS += -I/usr/local/Cellar/glew/1.10.0/include
|
||||
LDFLAGS += -L/usr/local/Cellar/glew/1.10.0/lib
|
||||
|
||||
|
||||
CXXFLAGS += -framework OpenGL -framework Cocoa -framework IOKit
|
||||
CXXFLAGS += -framework OpenAL
|
||||
|
||||
@@ -324,7 +326,7 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
|
||||
#Complete binary compile
|
||||
$(BINDIR)/$(BIN): makelibs $(OBJ_FILES) $(LIB_FILES) $(COPY_LIBS)
|
||||
@mkdir -p $(BINDIR)
|
||||
@$(CC) $(CXXFLAGS) $(LDFLAGS) $(OBJ_FILES) $(LIB_FILES) -o $@
|
||||
@$(CC) $(CXXFLAGS) $(OBJ_FILES) $(LIB_FILES) -o $@ $(LDFLAGS) -lGL -lGLU -lX11 -lXrandr -lXxf86vm -lXi -lopenal -lcurl -lpng -lvorbisfile
|
||||
|
||||
makelibs:
|
||||
@mkdir -p $(BINDIR)
|
||||
|
||||
@@ -60,7 +60,6 @@ for arg in $args; do
|
||||
export ARCH=32
|
||||
;;
|
||||
64)
|
||||
export ARCHFLAGS="-m64 -march=athlon64 -mtune=generic"
|
||||
export ARCH=64
|
||||
;;
|
||||
debug)
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
@@ -12,7 +12,6 @@ ifeq ($(ARCH), 32)
|
||||
ARCHNAME = x86
|
||||
else
|
||||
#Global
|
||||
CXXFLAGS += -m64 -march=athlon64 -mtune=generic
|
||||
|
||||
#Arch name
|
||||
ARCHNAME = x64
|
||||
|
||||
Reference in New Issue
Block a user