浏览代码

Fix compilation with SDL1
+ seems to be fully backward compatible (need more testing)

AlexVinS 11 年之前
父节点
当前提交
15fe37133c
共有 3 个文件被更改,包括 12 次插入11 次删除
  1. 1 1
      client/CMT.cpp
  2. 8 8
      client/VCMI_client.cbp
  3. 3 2
      client/gui/CIntObjectClasses.cpp

+ 1 - 1
client/CMT.cpp

@@ -815,7 +815,7 @@ static bool checkVideoMode(int monitorIndex, int w, int h, int& bpp, bool fullsc
 	return false;	
 	#else
 	bpp = SDL_VideoModeOK(w, h, bpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0));
-	return !(bpp==0)
+	return !(bpp==0);
 	#endif // VCMI_SDL1
 }
 

+ 8 - 8
client/VCMI_client.cbp

@@ -60,10 +60,10 @@
 					<Add directory="$(#sdl.include)" />
 				</Compiler>
 				<Linker>
-					<Add option="-lSDL.dll" />
-					<Add option="-lSDL_image.dll" />
-					<Add option="-lSDL_mixer.dll" />
-					<Add option="-lSDL_ttf.dll" />
+					<Add option="-lSDL" />
+					<Add option="-lSDL_image" />
+					<Add option="-lSDL_mixer" />
+					<Add option="-lSDL_ttf" />
 					<Add directory="$(#sdl.lib)" />
 				</Linker>
 			</Target>
@@ -81,10 +81,10 @@
 				</Compiler>
 				<Linker>
 					<Add option="-s" />
-					<Add option="-lSDL.dll" />
-					<Add option="-lSDL_image.dll" />
-					<Add option="-lSDL_mixer.dll" />
-					<Add option="-lSDL_ttf.dll" />
+					<Add option="-lSDL" />
+					<Add option="-lSDL_image" />
+					<Add option="-lSDL_mixer" />
+					<Add option="-lSDL_ttf" />
 					<Add directory="$(#sdl.lib)" />
 				</Linker>
 			</Target>

+ 3 - 2
client/gui/CIntObjectClasses.cpp

@@ -1651,6 +1651,9 @@ void CTextInput::keyPressed( const SDL_KeyboardEvent & key )
 	}
 
 	bool redrawNeeded = false;
+	#ifdef VCMI_SDL1
+	std::string oldText = text;
+	#endif // 0	
 	switch(key.keysym.sym)
 	{
 	case SDLK_DELETE: // have index > ' ' so it won't be filtered out by default section
@@ -1687,8 +1690,6 @@ void CTextInput::keyPressed( const SDL_KeyboardEvent & key )
 		redraw();
 		cb(text);
 	}	
-	
-	//todo: handle text input for SDL2
 }
 
 void CTextInput::setText( const std::string &nText, bool callCb )