mudgangster

Log | Files | Refs

commit 348a2def10a1855ce420e2184afcd8d69cd07077
parent bb58219652d7dc73ad24f2920d6623f216598339
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri,  7 Sep 2018 14:26:30 +0300

Same for Windows

Diffstat:
src/common.h | 2--
src/platform_network.h | 1+
src/ui.h | 3---
src/win32.cc | 14++++++--------
src/x11.cc | 8--------
5 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/src/common.h b/src/common.h @@ -13,8 +13,6 @@ typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; -typedef int64_t s64; - #define FATAL( form, ... ) \ do { \ printf( "[FATAL] " form, ##__VA_ARGS__ ); \ diff --git a/src/platform_network.h b/src/platform_network.h @@ -4,6 +4,7 @@ #include "common.h" #if PLATFORM_WINDOWS +#include <winsock2.h> typedef SOCKET OSSocket; #elif PLATFORM_UNIX typedef int OSSocket; diff --git a/src/ui.h b/src/ui.h @@ -25,11 +25,8 @@ void ui_draw_status(); void ui_clear_status(); void ui_statusAdd( char c, Colour fg, bool bold ); -void ui_main_draw(); void ui_main_newline(); void ui_main_print( const char * str, size_t len, Colour fg, Colour bg, bool bold ); - -void ui_chat_draw(); void ui_chat_newline(); void ui_chat_print( const char * str, size_t len, Colour fg, Colour bg, bool bold ); diff --git a/src/win32.cc b/src/win32.cc @@ -403,10 +403,6 @@ void ui_draw() { void ui_handleXEvents() { } -void ui_main_draw() { - textbox_draw( &UI.main_text ); -} - void ui_main_newline() { textbox_newline( &UI.main_text ); } @@ -415,10 +411,6 @@ void ui_main_print( const char * str, size_t len, Colour fg, Colour bg, bool bol textbox_add( &UI.main_text, str, len, fg, bg, bold ); } -void ui_chat_draw() { - textbox_draw( &UI.chat_text ); -} - void ui_chat_newline() { textbox_newline( &UI.chat_text ); } @@ -735,6 +727,12 @@ LRESULT CALLBACK WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { default: return DefWindowProc(hwnd, msg, wParam, lParam); } + + if( UI.main_text.dirty ) + textbox_draw( &UI.main_text ); + if( UI.chat_text.dirty ) + textbox_draw( &UI.chat_text ); + return 0; } diff --git a/src/x11.cc b/src/x11.cc @@ -864,10 +864,6 @@ void ui_init() { ui_handleXEvents(); } -void ui_main_draw() { - textbox_draw( &UI.main_text ); -} - void ui_main_newline() { textbox_newline( &UI.main_text ); } @@ -876,10 +872,6 @@ void ui_main_print( const char * str, size_t len, Colour fg, Colour bg, bool bol textbox_add( &UI.main_text, str, len, fg, bg, bold ); } -void ui_chat_draw() { - textbox_draw( &UI.chat_text ); -} - void ui_chat_newline() { textbox_newline( &UI.chat_text ); }