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

Linux build completely broken #25

Open
pseregiet opened this issue Jan 23, 2024 · 2 comments
Open

Linux build completely broken #25

pseregiet opened this issue Jan 23, 2024 · 2 comments

Comments

@pseregiet
Copy link

pseregiet commented Jan 23, 2024

Code doesn't build on Linux because of few errors and even missing cpp files in the Cmake. Is the CMake not maintained at all ? I've fixed the build as best as I could and I get the editor to start up, however, when opening a new empty map the program eventually crashes. I'm trying to debug it but no luck so far with even getting a trace (it crashes on some X11 error)

Here's my diff to even get you started on Linux, but please let me know if this fork is even supported or is it completely broken and abandoned.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2f8d6b..71184fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
 cmake_minimum_required(VERSION 3.1)
 
 project(rme)
-
 if(NOT CMAKE_BUILD_TYPE)
 	set(CMAKE_BUILD_TYPE RelWithDebInfo)
 endif()
@@ -37,4 +36,4 @@ set_target_properties(rme PROPERTIES CXX_STANDARD 17)
 set_target_properties(rme PROPERTIES CXX_STANDARD_REQUIRED ON)
 
 include_directories(${Boost_INCLUDE_DIRS} ${LibArchive_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
-target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES})
\ No newline at end of file
+target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES})
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 421e2c0..b44c665 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -1,6 +1,7 @@
 set(rme_H
 ${CMAKE_CURRENT_LIST_DIR}/about_window.h
 ${CMAKE_CURRENT_LIST_DIR}/action.h
+${CMAKE_CURRENT_LIST_DIR}/add_item_window.h
 ${CMAKE_CURRENT_LIST_DIR}/application.h
 ${CMAKE_CURRENT_LIST_DIR}/artprovider.h
 ${CMAKE_CURRENT_LIST_DIR}/basemap.h
@@ -95,6 +96,8 @@ ${CMAKE_CURRENT_LIST_DIR}/templates.h
 ${CMAKE_CURRENT_LIST_DIR}/threads.h
 ${CMAKE_CURRENT_LIST_DIR}/tile.h
 ${CMAKE_CURRENT_LIST_DIR}/tileset.h
+${CMAKE_CURRENT_LIST_DIR}/tileset_window.h
+${CMAKE_CURRENT_LIST_DIR}/add_tileset_window.h
 ${CMAKE_CURRENT_LIST_DIR}/town.h
 ${CMAKE_CURRENT_LIST_DIR}/updater.h
 ${CMAKE_CURRENT_LIST_DIR}/wall_brush.h
@@ -106,6 +109,7 @@ ${CMAKE_CURRENT_LIST_DIR}/welcome_dialog.h
 set(rme_SRC
 ${CMAKE_CURRENT_LIST_DIR}/about_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/action.cpp
+${CMAKE_CURRENT_LIST_DIR}/add_item_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/application.cpp
 ${CMAKE_CURRENT_LIST_DIR}/artprovider.cpp
 ${CMAKE_CURRENT_LIST_DIR}/basemap.cpp
@@ -192,6 +196,8 @@ ${CMAKE_CURRENT_LIST_DIR}/templatemap854.cpp
 ${CMAKE_CURRENT_LIST_DIR}/templatemapclassic.cpp
 ${CMAKE_CURRENT_LIST_DIR}/tile.cpp
 ${CMAKE_CURRENT_LIST_DIR}/tileset.cpp
+${CMAKE_CURRENT_LIST_DIR}/tileset_window.cpp
+${CMAKE_CURRENT_LIST_DIR}/add_tileset_window.cpp
 ${CMAKE_CURRENT_LIST_DIR}/town.cpp
 ${CMAKE_CURRENT_LIST_DIR}/updater.cpp
 ${CMAKE_CURRENT_LIST_DIR}/wall_brush.cpp
diff --git a/source/graphics.cpp b/source/graphics.cpp
index 3c08d61..9b15a2c 100644
--- a/source/graphics.cpp
+++ b/source/graphics.cpp
@@ -1147,6 +1147,8 @@ void GameSprite::Image::createGLTexture(GLuint whatid) {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 0x812F); // GL_CLAMP_TO_EDGE
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SPRITE_PIXELS, SPRITE_PIXELS, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba);
 
+	printf("gfx: texture %u\n", whatid);
+
 	delete[] rgba;
 #undef SPRITE_SIZE
 }
diff --git a/source/light_drawer.cpp b/source/light_drawer.cpp
index 33122ef..c88f96c 100644
--- a/source/light_drawer.cpp
+++ b/source/light_drawer.cpp
@@ -143,8 +143,13 @@ void LightDrawer::clear() noexcept {
 }
 
 void LightDrawer::createGLTexture() {
+	texture = 0xdeadbeef;
 	glGenTextures(1, &texture);
-	ASSERT(texture == 0);
+	printf("tex: %u\n", texture);
+	auto code = glGetError();
+	fprintf(stderr, "OpenGL error: %d, %u\n", code, texture);
+
+	//ASSERT(texture == 0);
 }
 
 void LightDrawer::unloadGLTexture() {
diff --git a/source/map_drawer.cpp b/source/map_drawer.cpp
index 7cf6539..8ebf916 100644
--- a/source/map_drawer.cpp
+++ b/source/map_drawer.cpp
@@ -178,6 +178,13 @@ void MapDrawer::SetupGL() {
 	glPushMatrix();
 	glLoadIdentity();
 	glTranslatef(0.375f, 0.375f, 0.0f);
+
+	printf("SetupGL()\n");
+
+	GLuint texture = 0xdeadbeef;
+	glGenTextures(1, &texture);
+	auto code = glGetError();
+	fprintf(stderr, "OpenGL status: %d, %x\n", code, texture);
 }
 
 void MapDrawer::Release() {
@@ -1456,7 +1463,7 @@ void MapDrawer::WriteTooltip(Item* item, std::ostringstream& stream, bool isHous
 		stream << "text: " << text << "\n";
 	}
 	if (tp) {
-		Position& dest = tp->getDestination();
+		auto dest = tp->getDestination();
 		stream << "destination: " << dest.x << ", " << dest.y << ", " << dest.z << "\n";
 	}
 }
@@ -1870,7 +1877,7 @@ void MapDrawer::AddLight(TileLocation* location) {
 		return;
 	}
 
-	auto& position = location->getPosition();
+	auto position = location->getPosition();
 
 	if (tile->ground) {
 		if (tile->ground->hasLight()) {
diff --git a/source/old_properties_window.cpp b/source/old_properties_window.cpp
index ddbcd28..a7b27c4 100644
--- a/source/old_properties_window.cpp
+++ b/source/old_properties_window.cpp
@@ -771,7 +771,7 @@ void OldPropertiesWindow::OnClickOK(wxCommandEvent& WXUNUSED(event)) {
 				}
 			}
 
-			Outfit& newOutfit = Outfit();
+			auto newOutfit = Outfit();
 			if (podium) {
 				int newLookType = look_type->GetValue();
 				int newMount = look_mount->GetValue();
diff --git a/source/palette_brushlist.cpp b/source/palette_brushlist.cpp
index 9d555e3..3f5994d 100644
--- a/source/palette_brushlist.cpp
+++ b/source/palette_brushlist.cpp
@@ -255,7 +255,7 @@ void BrushPalettePanel::OnClickAddItemToTileset(wxCommandEvent& WXUNUSED(event))
 	if (!choicebook) {
 		return;
 	}
-	std::string tilesetName = choicebook->GetPageText(choicebook->GetSelection());
+	std::string tilesetName = choicebook->GetPageText(choicebook->GetSelection()).ToStdString();
 
 	auto _it = g_materials.tilesets.find(tilesetName);
 	if (_it != g_materials.tilesets.end()) {

@pseregiet pseregiet changed the title KLinux build completely broken Linux build completely broken Jan 23, 2024
@Zbizu
Copy link
Member

Zbizu commented Jan 31, 2024

hey, the fork is not actively maintained due to lack of time

@Ezzz-dev
Copy link

Ezzz-dev commented Oct 1, 2024

Indeed, can corroborate the X11 something error crash when opening the application on Linux.

Crash data when breaking on _XError:

#8 0x00005555564ee766 in _gdk_x11_display_create_window_impl ()
No symbol table info available.
#9 0x000055555651a63e in gdk_window_ensure_native ()
No symbol table info available.
#10 0x00005555564efcc0 in gdk_x11_window_get_xid ()
No symbol table info available.
#11 0x0000555555c3ec3d in wxGLCanvasEGL::SwapBuffers() ()
No symbol table info available.
#12 0x0000555555a9fa66 in MapCanvas::OnPaint(wxPaintEvent&) ()

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

No branches or pull requests

3 participants