Просмотр исходного кода

Switch from ce_assert to CE_ASSERT

Daniele Bartolini 12 лет назад
Родитель
Сommit
76a15ac81d

+ 1 - 1
src/Device.cpp

@@ -427,7 +427,7 @@ void Device::create_window()
 {
 	m_window = new OsWindow(m_preferred_window_width, m_preferred_window_height);
 
-	ce_assert(m_window != NULL, "Unable to create the window");
+	CE_ASSERT(m_window != NULL, "Unable to create the window");
 
 	m_window->set_title("Crown Game Engine");
 	m_window->show();

+ 2 - 2
src/PixelShaderResource.cpp

@@ -38,7 +38,7 @@ void* PixelShaderResource::load(Allocator& allocator, ResourceArchive& archive,
 {
 	FileStream* stream = archive.open(id);
 
-	ce_assert(stream != NULL, "Resource does not exist: %.8X%.8X", id.name, id.type);
+	CE_ASSERT(stream != NULL, "Resource does not exist: %.8X%.8X", id.name, id.type);
 
 	PixelShaderResource* resource = (PixelShaderResource*)allocator.allocate(sizeof(PixelShaderResource));
 
@@ -58,7 +58,7 @@ void* PixelShaderResource::load(Allocator& allocator, ResourceArchive& archive,
 //-----------------------------------------------------------------------------
 void PixelShaderResource::unload(Allocator& allocator, void* resource)
 {
-	ce_assert(resource != NULL, "Resource not loaded");
+	CE_ASSERT(resource != NULL, "Resource not loaded");
 
 	((PixelShaderResource*)resource)->m_program_text_length = 0;
 

+ 2 - 2
src/VertexShaderResource.cpp

@@ -38,7 +38,7 @@ void* VertexShaderResource::load(Allocator& allocator, ResourceArchive& archive,
 {
 	FileStream* stream = archive.open(id);
 
-	ce_assert(stream != NULL, "Resource does not exist: %.8X%.8X", id.name, id.type);
+	CE_ASSERT(stream != NULL, "Resource does not exist: %.8X%.8X", id.name, id.type);
 
 	VertexShaderResource* resource = (VertexShaderResource*)allocator.allocate(sizeof(VertexShaderResource));
 
@@ -58,7 +58,7 @@ void* VertexShaderResource::load(Allocator& allocator, ResourceArchive& archive,
 //-----------------------------------------------------------------------------
 void VertexShaderResource::unload(Allocator& allocator, void* resource)
 {
-	ce_assert(resource != NULL, "Resource not loaded");
+	CE_ASSERT(resource != NULL, "Resource not loaded");
 
 	((VertexShaderResource*)resource)->m_program_text_length = 0;
 

+ 3 - 3
src/os/linux/OsWindow.cpp

@@ -101,11 +101,11 @@ OsWindow::OsWindow(uint32_t width, uint32_t height) :
 	m_x11_detectable_autorepeat(false),
 	m_x11_hidden_cursor(None)
 {
-	ce_assert(width != 0 || height != 0, "Width and height must differ from zero");
+	CE_ASSERT(width != 0 || height != 0, "Width and height must differ from zero");
 
 	m_x11_display = XOpenDisplay(NULL);
 
-	ce_assert(m_x11_display != NULL, "Unable to open X11 display");
+	CE_ASSERT(m_x11_display != NULL, "Unable to open X11 display");
 
 	int screen = DefaultScreen(m_x11_display);
 	Window root_window = RootWindow(m_x11_display, screen);
@@ -132,7 +132,7 @@ OsWindow::OsWindow(uint32_t width, uint32_t height) :
 				   &win_attribs
 			   );
 
-	ce_assert(m_x11_window != None, "Unable to create X window");
+	CE_ASSERT(m_x11_window != None, "Unable to create X window");
 
 	// Check presence of detectable autorepeat
 	Bool detectable;

+ 3 - 3
src/renderers/gl/glx/GLContext.cpp

@@ -64,13 +64,13 @@ void GLContext::create_context()
 
 	int fb_count;
 	GLXFBConfig* fb_config = glXChooseFBConfig(s_x11_display, DefaultScreen(s_x11_display), fb_attribs, &fb_count);
-	ce_assert(fb_config != NULL, "Unable to find a matching frame buffer configuration");
+	CE_ASSERT(fb_config != NULL, "Unable to find a matching frame buffer configuration");
 
 	XVisualInfo* vi = glXGetVisualFromFBConfig(s_x11_display, fb_config[0]);
-	ce_assert(vi != NULL, "Unable to find a matching visual for frame buffer configuration.");
+	CE_ASSERT(vi != NULL, "Unable to find a matching visual for frame buffer configuration.");
 
 	m_glx_context = glXCreateContext(s_x11_display, vi, 0, True);
-	ce_assert(m_glx_context != NULL, "Unable to create GLX context");
+	CE_ASSERT(m_glx_context != NULL, "Unable to create GLX context");
 
 	glXMakeCurrent(s_x11_display, s_x11_window, m_glx_context);