mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
* added fast graphical cursor :)
* building structures should work
This commit is contained in:
@@ -510,7 +510,9 @@ void CCastleInterface::deactivate()
|
|||||||
void CCastleInterface::addBuilding(int bid)
|
void CCastleInterface::addBuilding(int bid)
|
||||||
{
|
{
|
||||||
//TODO: lepiej by bylo tylko dodawac co trzeba pamietajac o grupach
|
//TODO: lepiej by bylo tylko dodawac co trzeba pamietajac o grupach
|
||||||
|
deactivate();
|
||||||
recreateBuildings();
|
recreateBuildings();
|
||||||
|
activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCastleInterface::removeBuilding(int bid)
|
void CCastleInterface::removeBuilding(int bid)
|
||||||
@@ -916,12 +918,12 @@ void CHallInterface::CBuildWindow::deactivate()
|
|||||||
}
|
}
|
||||||
void CHallInterface::CBuildWindow::Buy()
|
void CHallInterface::CBuildWindow::Buy()
|
||||||
{
|
{
|
||||||
LOCPLINT->cb->buildBuilding(LOCPLINT->castleInt->town,bid);
|
|
||||||
deactivate();
|
deactivate();
|
||||||
delete this;
|
|
||||||
delete LOCPLINT->castleInt->hallInt;
|
|
||||||
LOCPLINT->castleInt->hallInt = NULL;
|
LOCPLINT->castleInt->hallInt = NULL;
|
||||||
LOCPLINT->castleInt->activate();
|
LOCPLINT->castleInt->activate();
|
||||||
|
LOCPLINT->cb->buildBuilding(LOCPLINT->castleInt->town,bid);
|
||||||
|
delete this;
|
||||||
|
delete LOCPLINT->castleInt->hallInt;
|
||||||
LOCPLINT->castleInt->showAll();
|
LOCPLINT->castleInt->showAll();
|
||||||
}
|
}
|
||||||
void CHallInterface::CBuildWindow::close()
|
void CHallInterface::CBuildWindow::close()
|
||||||
|
|||||||
@@ -1,237 +1,51 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "CCursorHandler.h"
|
#include "CCursorHandler.h"
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_thread.h"
|
#include "SDL_Extensions.h"
|
||||||
#include "CGameInfo.h"
|
#include "CGameInfo.h"
|
||||||
#include "SDL_framerate.h"
|
#include "hch/CDefHandler.h"
|
||||||
#include "hch/CLodHandler.h"
|
|
||||||
|
|
||||||
extern SDL_Surface * screen;
|
extern SDL_Surface * screen;
|
||||||
|
|
||||||
/* Creates a new mouse cursor from an XPM */
|
|
||||||
|
|
||||||
|
|
||||||
/* XPM */
|
|
||||||
static const char *arrow[] = { //no cursor mode
|
|
||||||
/* width height num_colors chars_per_pixel */
|
|
||||||
" 32 32 3 1",
|
|
||||||
/* colors */
|
|
||||||
"X c #000000",
|
|
||||||
". c #ffffff",
|
|
||||||
" c None",
|
|
||||||
/* pixels */
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
"0,0"
|
|
||||||
};
|
|
||||||
|
|
||||||
/* XPM */
|
|
||||||
static const char *arrow2[] = { //normal cursor
|
|
||||||
/* width height num_colors chars_per_pixel */
|
|
||||||
" 32 32 3 1",
|
|
||||||
/* colors */
|
|
||||||
"X c #000000",
|
|
||||||
". c #ffffff",
|
|
||||||
" c None",
|
|
||||||
/* pixels */
|
|
||||||
"X ",
|
|
||||||
"XX ",
|
|
||||||
"X.X ",
|
|
||||||
"X..X ",
|
|
||||||
"X...X ",
|
|
||||||
"X....X ",
|
|
||||||
"X.....X ",
|
|
||||||
"X......X ",
|
|
||||||
"X.......X ",
|
|
||||||
"X........X ",
|
|
||||||
"X.....XXXXX ",
|
|
||||||
"X..X..X ",
|
|
||||||
"X.X X..X ",
|
|
||||||
"XX X..X ",
|
|
||||||
"X X..X ",
|
|
||||||
" X..X ",
|
|
||||||
" X..X ",
|
|
||||||
" X..X ",
|
|
||||||
" XX ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
"0,0"
|
|
||||||
};
|
|
||||||
|
|
||||||
static SDL_Cursor *init_system_cursor(const char *image[])
|
|
||||||
{
|
|
||||||
int i, row, col;
|
|
||||||
Uint8 data[4*32];
|
|
||||||
Uint8 mask[4*32];
|
|
||||||
int hot_x, hot_y;
|
|
||||||
|
|
||||||
i = -1;
|
|
||||||
for ( row=0; row<32; ++row ) {
|
|
||||||
for ( col=0; col<32; ++col ) {
|
|
||||||
if ( col % 8 ) {
|
|
||||||
data[i] <<= 1;
|
|
||||||
mask[i] <<= 1;
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
data[i] = mask[i] = 0;
|
|
||||||
}
|
|
||||||
switch (image[4+row][col]) {
|
|
||||||
case 'X':
|
|
||||||
data[i] |= 0x01;
|
|
||||||
//k[i] |= 0x01;
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
mask[i] |= 0x01;
|
|
||||||
break;
|
|
||||||
case ' ':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
|
|
||||||
return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
//int cursorHandlerFunc(void * cursorHandler)
|
|
||||||
//{
|
|
||||||
// FPSmanager * cursorFramerateKeeper = new FPSmanager;
|
|
||||||
// SDL_initFramerate(cursorFramerateKeeper);
|
|
||||||
// SDL_setFramerate(cursorFramerateKeeper, 200);
|
|
||||||
//
|
|
||||||
// CCursorHandler * ch = (CCursorHandler *) cursorHandler;
|
|
||||||
// while(true)
|
|
||||||
// {
|
|
||||||
// if(ch->xbef!=-1 && ch->ybef!=-1) //restore surface under cursor
|
|
||||||
// {
|
|
||||||
// blitAtWR(ch->behindCur, ch->xbef, ch->ybef);
|
|
||||||
// }
|
|
||||||
// ch->xbef = ch->xpos;
|
|
||||||
// ch->ybef = ch->ypos;
|
|
||||||
// //prepare part of surface to restore
|
|
||||||
// SDL_BlitSurface(screen, &genRect(32, 32, ch->xpos, ch->ypos), ch->behindCur, NULL);
|
|
||||||
// CSDL_Ext::update(ch->behindCur);
|
|
||||||
//
|
|
||||||
// //blit cursor
|
|
||||||
// if(ch->curVisible)
|
|
||||||
// {
|
|
||||||
// switch(ch->mode)
|
|
||||||
// {
|
|
||||||
// case 0:
|
|
||||||
// {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 1:
|
|
||||||
// {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 2:
|
|
||||||
// {
|
|
||||||
// blitAtWR(ch->deflt->ourImages[ch->number].bitmap, ch->xpos, ch->ypos);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// SDL_framerateDelay(cursorFramerateKeeper);
|
|
||||||
// //SDL_Delay(5); //to avoid great usage of CPU
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
|
|
||||||
void CCursorHandler::initCursor()
|
void CCursorHandler::initCursor()
|
||||||
{
|
{
|
||||||
//#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||||
// int rmask = 0xff000000;
|
int rmask = 0xff000000;
|
||||||
// int gmask = 0x00ff0000;
|
int gmask = 0x00ff0000;
|
||||||
// int bmask = 0x0000ff00;
|
int bmask = 0x0000ff00;
|
||||||
// int amask = 0x000000ff;
|
int amask = 0x000000ff;
|
||||||
//#else
|
#else
|
||||||
// int rmask = 0x000000ff;
|
int rmask = 0x000000ff;
|
||||||
// int gmask = 0x0000ff00;
|
int gmask = 0x0000ff00;
|
||||||
// int bmask = 0x00ff0000;
|
int bmask = 0x00ff0000;
|
||||||
// int amask = 0xff000000;
|
int amask = 0xff000000;
|
||||||
//#endif
|
#endif
|
||||||
// curVisible = true;
|
mode = number = xpos = ypos = 0;
|
||||||
// xpos = ypos = 0;
|
help = CSDL_Ext::newSurface(32,32);
|
||||||
// behindCur = SDL_CreateRGBSurface(SDL_SWSURFACE, 32, 32, 32, rmask, gmask, bmask, amask);
|
cursors.push_back(CDefHandler::giveDef("CRADVNTR.DEF"));
|
||||||
// xbef = ybef = 0;
|
cursors.push_back(CDefHandler::giveDef("CRCOMBAT.DEF"));
|
||||||
// adventure = CDefHandler::giveDef("CRADVNTR.DEF");
|
cursors.push_back(CDefHandler::giveDef("CRDEFLT.DEF"));
|
||||||
// combat = CDefHandler::giveDef("CRCOMBAT.DEF");
|
cursors.push_back(CDefHandler::giveDef("CRSPELL.DEF"));
|
||||||
// deflt = CDefHandler::giveDef("CRDEFLT.DEF");
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
// spell = CDefHandler::giveDef("CRSPELL.DEF");
|
|
||||||
// //SDL_SetCursor(init_system_cursor(arrow));
|
|
||||||
// //SDL_Thread * myth = SDL_CreateThread(&cursorHandlerFunc, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCursorHandler::changeGraphic(int type, int no)
|
void CCursorHandler::changeGraphic(int type, int no)
|
||||||
{
|
{
|
||||||
//mode = type;
|
mode = type;
|
||||||
//number = no;
|
number = no;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCursorHandler::cursorMove(int x, int y)
|
void CCursorHandler::cursorMove(int x, int y)
|
||||||
{
|
{
|
||||||
//xbef = xpos;
|
xpos = x;
|
||||||
//ybef = ypos;
|
ypos = y;
|
||||||
//xpos = x;
|
|
||||||
//ypos = y;
|
|
||||||
}
|
}
|
||||||
|
void CCursorHandler::draw1()
|
||||||
void CCursorHandler::hardwareCursor()
|
|
||||||
{
|
{
|
||||||
//curVisible = false;
|
SDL_BlitSurface(screen,&genRect(32,32,xpos,ypos),help,&genRect(32,32,0,0));
|
||||||
//SDL_SetCursor(init_system_cursor(arrow2));
|
blitAt(cursors[mode]->ourImages[number].bitmap,xpos,ypos);
|
||||||
}
|
}
|
||||||
|
void CCursorHandler::draw2()
|
||||||
void CCursorHandler::hideCursor()
|
|
||||||
{
|
{
|
||||||
//curVisible = false;
|
blitAt(help,xpos,ypos);
|
||||||
//SDL_SetCursor(init_system_cursor(arrow));
|
|
||||||
}
|
|
||||||
|
|
||||||
void CCursorHandler::showGraphicCursor()
|
|
||||||
{
|
|
||||||
//curVisible = true;
|
|
||||||
//SDL_SetCursor(init_system_cursor(arrow));
|
|
||||||
//changeGraphic(0, 0);
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef CCURSORHANDLER_H
|
#ifndef CCURSORHANDLER_H
|
||||||
#define CCURSORHANDLER_H
|
#define CCURSORHANDLER_H
|
||||||
|
#include "global.h"
|
||||||
|
#include <vector>
|
||||||
struct SDL_Thread;
|
struct SDL_Thread;
|
||||||
class CDefHandler;
|
class CDefHandler;
|
||||||
struct SDL_Surface;
|
struct SDL_Surface;
|
||||||
@@ -8,21 +9,16 @@ struct SDL_Surface;
|
|||||||
class CCursorHandler //handles cursor
|
class CCursorHandler //handles cursor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SDL_Thread * myThread; //thread that updates cursor
|
|
||||||
bool curVisible; //true if cursor is visible
|
|
||||||
int mode, number;
|
int mode, number;
|
||||||
SDL_Surface * behindCur;
|
SDL_Surface * help;
|
||||||
int xbef, ybef; //position of cursor after last move (to restore background)
|
|
||||||
|
|
||||||
CDefHandler * adventure, * combat, * deflt, * spell; //read - only
|
std::vector<CDefHandler*> cursors;
|
||||||
int xpos, ypos; //position of cursor - read only
|
int xpos, ypos; //position of cursor
|
||||||
void initCursor(); //inits cursorHandler
|
void initCursor(); //inits cursorHandler
|
||||||
void showGraphicCursor(); //shows default graphic cursor
|
|
||||||
void cursorMove(int x, int y); //change cursor's positions to (x, y)
|
void cursorMove(int x, int y); //change cursor's positions to (x, y)
|
||||||
void changeGraphic(int type, int no); //changes cursor graphic for type type (0 - adventure, 1 - combat, 2 - default, 3 - spellbook) and frame no (not used for type 3)
|
void changeGraphic(int type, int no); //changes cursor graphic for type type (0 - adventure, 1 - combat, 2 - default, 3 - spellbook) and frame no (not used for type 3)
|
||||||
void hideCursor(); //no cursor will be visible
|
void draw1();
|
||||||
void hardwareCursor(); // returns to hardware cursor mode
|
void draw2();
|
||||||
friend int cursorHandlerFunc(void * cursorHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ void CGameState::apply(IPack * pack)
|
|||||||
case 104:
|
case 104:
|
||||||
{
|
{
|
||||||
SetResources *sr = static_cast<SetResources*>(pack);
|
SetResources *sr = static_cast<SetResources*>(pack);
|
||||||
for(int i=0;sr->res.size();i++)
|
for(int i=0;i<sr->res.size();i++)
|
||||||
players[sr->player].resources[i] = sr->res[i];
|
players[sr->player].resources[i] = sr->res[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
9
CMT.cpp
9
CMT.cpp
@@ -89,8 +89,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
//audio initialized
|
//audio initialized
|
||||||
cgi->consoleh = new CConsoleHandler;
|
cgi->consoleh = new CConsoleHandler;
|
||||||
cgi->mush = mush;
|
cgi->mush = mush;
|
||||||
cgi->curh = new CCursorHandler;
|
THC std::cout<<"\tInitializing sound: "<<pomtime.getDif()<<std::endl;
|
||||||
THC std::cout<<"\tInitializing sound and cursor: "<<pomtime.getDif()<<std::endl;
|
|
||||||
THC std::cout<<"Initializing screen, fonts and sound handling: "<<tmh.getDif()<<std::endl;
|
THC std::cout<<"Initializing screen, fonts and sound handling: "<<tmh.getDif()<<std::endl;
|
||||||
CDefHandler::Spriteh = cgi->spriteh = new CLodHandler();
|
CDefHandler::Spriteh = cgi->spriteh = new CLodHandler();
|
||||||
cgi->spriteh->init("Data\\H3sprite.lod","Sprites");
|
cgi->spriteh->init("Data\\H3sprite.lod","Sprites");
|
||||||
@@ -112,8 +111,10 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
//cgi->curh->initCursor();
|
//cgi->curh->initCursor();
|
||||||
//cgi->curh->showGraphicCursor();
|
//cgi->curh->showGraphicCursor();
|
||||||
pomtime.getDif();
|
pomtime.getDif();
|
||||||
cgi->screenh = new CScreenHandler;
|
cgi->curh = new CCursorHandler;
|
||||||
cgi->screenh->initScreen();
|
cgi->curh->initCursor();
|
||||||
|
//cgi->screenh = new CScreenHandler;
|
||||||
|
//cgi->screenh->initScreen();
|
||||||
THC std::cout<<"\tScreen handler: "<<pomtime.getDif()<<std::endl;
|
THC std::cout<<"\tScreen handler: "<<pomtime.getDif()<<std::endl;
|
||||||
|
|
||||||
CAbilityHandler * abilh = new CAbilityHandler;
|
CAbilityHandler * abilh = new CAbilityHandler;
|
||||||
|
|||||||
@@ -957,7 +957,7 @@ void CPlayerInterface::yourTurn()
|
|||||||
//initializing framerate keeper
|
//initializing framerate keeper
|
||||||
mainFPSmng = new FPSmanager;
|
mainFPSmng = new FPSmanager;
|
||||||
SDL_initFramerate(mainFPSmng);
|
SDL_initFramerate(mainFPSmng);
|
||||||
SDL_setFramerate(mainFPSmng, 24);
|
SDL_setFramerate(mainFPSmng, 48);
|
||||||
SDL_Event sEvent;
|
SDL_Event sEvent;
|
||||||
//framerate keeper initialized
|
//framerate keeper initialized
|
||||||
timeHandler th;
|
timeHandler th;
|
||||||
@@ -993,7 +993,7 @@ void CPlayerInterface::yourTurn()
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//water tiles updated
|
//water tiles updated
|
||||||
CGI->screenh->updateScreen();
|
//CGI->screenh->updateScreen();
|
||||||
|
|
||||||
pim->lock();
|
pim->lock();
|
||||||
|
|
||||||
@@ -1016,7 +1016,7 @@ void CPlayerInterface::yourTurn()
|
|||||||
if (!castleInt) //stuff for advMapInt
|
if (!castleInt) //stuff for advMapInt
|
||||||
{
|
{
|
||||||
++LOCPLINT->adventureInt->animValHitCount; //for animations
|
++LOCPLINT->adventureInt->animValHitCount; //for animations
|
||||||
if(LOCPLINT->adventureInt->animValHitCount == 4)
|
if(LOCPLINT->adventureInt->animValHitCount == 8)
|
||||||
{
|
{
|
||||||
LOCPLINT->adventureInt->animValHitCount = 0;
|
LOCPLINT->adventureInt->animValHitCount = 0;
|
||||||
++animVal;
|
++animVal;
|
||||||
@@ -1074,9 +1074,9 @@ void CPlayerInterface::yourTurn()
|
|||||||
for(int i=0;i<objsToBlit.size();i++)
|
for(int i=0;i<objsToBlit.size();i++)
|
||||||
objsToBlit[i]->show();
|
objsToBlit[i]->show();
|
||||||
pim->unlock();
|
pim->unlock();
|
||||||
//SDL_Flip(screen);
|
CGI->curh->draw1();
|
||||||
CSDL_Ext::update(screen);
|
CSDL_Ext::update(screen);
|
||||||
SDL_Delay(5); //give time for other apps
|
CGI->curh->draw2();
|
||||||
SDL_framerateDelay(mainFPSmng);
|
SDL_framerateDelay(mainFPSmng);
|
||||||
}
|
}
|
||||||
adventureInt->hide();
|
adventureInt->hide();
|
||||||
@@ -1146,7 +1146,6 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
|||||||
//initializing objects and performing first step of move
|
//initializing objects and performing first step of move
|
||||||
CGHeroInstance * ho = details.ho; //object representing this hero
|
CGHeroInstance * ho = details.ho; //object representing this hero
|
||||||
int3 hp = details.src;
|
int3 hp = details.src;
|
||||||
boost::unique_lock<boost::mutex> un(*pim);
|
|
||||||
if (!details.successful)
|
if (!details.successful)
|
||||||
{
|
{
|
||||||
ho->moveDir = getDir(details.src,details.dst);
|
ho->moveDir = getDir(details.src,details.dst);
|
||||||
@@ -1486,7 +1485,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
|||||||
}
|
}
|
||||||
LOCPLINT->adventureInt->update(); //updating screen
|
LOCPLINT->adventureInt->update(); //updating screen
|
||||||
CSDL_Ext::update(screen);
|
CSDL_Ext::update(screen);
|
||||||
CGI->screenh->updateScreen();
|
//CGI->screenh->updateScreen();
|
||||||
|
|
||||||
++LOCPLINT->adventureInt->animValHitCount; //for animations
|
++LOCPLINT->adventureInt->animValHitCount; //for animations
|
||||||
if(LOCPLINT->adventureInt->animValHitCount == 4)
|
if(LOCPLINT->adventureInt->animValHitCount == 4)
|
||||||
|
|||||||
BIN
CPreGame.cpp
BIN
CPreGame.cpp
Binary file not shown.
@@ -1,45 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
#include "CScreenHandler.h"
|
|
||||||
#include "SDL.h"
|
|
||||||
#include "SDL_thread.h"
|
|
||||||
#include "SDL_framerate.h"
|
|
||||||
#include "SDL_Extensions.h"
|
|
||||||
#include "CCursorHandler.h"
|
|
||||||
#include "CGameInfo.h"
|
|
||||||
#include "hch/CDefHandler.h"
|
|
||||||
|
|
||||||
extern SDL_Surface * screen, * screen2;
|
|
||||||
|
|
||||||
void CScreenHandler::initScreen()
|
|
||||||
{
|
|
||||||
//myth = SDL_CreateThread(&internalScreenFunc, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CScreenHandler::updateScreen()
|
|
||||||
{
|
|
||||||
/*blitAt(screen, 0, 0, screen2);
|
|
||||||
switch(CGI->curh->mode)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
blitAt(CGI->curh->adventure->ourImages[CGI->curh->number].bitmap, CGI->curh->xpos, CGI->curh->ypos, screen2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
blitAt(CGI->curh->combat->ourImages[CGI->curh->number].bitmap, CGI->curh->xpos, CGI->curh->ypos, screen2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
blitAt(CGI->curh->deflt->ourImages[CGI->curh->number].bitmap, CGI->curh->xpos, CGI->curh->ypos, screen2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
blitAt(CGI->curh->spell->ourImages[CGI->curh->number].bitmap, CGI->curh->xpos, CGI->curh->ypos, screen2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CSDL_Ext::update(screen2);*/
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#ifndef CSCREENHANDLER_H
|
|
||||||
#define CSCREENHANDLER_H
|
|
||||||
|
|
||||||
struct SDL_Thread;
|
|
||||||
|
|
||||||
class CScreenHandler
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
SDL_Thread * myth;
|
|
||||||
public:
|
|
||||||
void initScreen();
|
|
||||||
void updateScreen();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //CSCREENHANDLER_H
|
|
||||||
@@ -357,10 +357,6 @@
|
|||||||
RelativePath="..\hch\CPreGameTextHandler.cpp"
|
RelativePath="..\hch\CPreGameTextHandler.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\CScreenHandler.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\hch\CSndHandler.cpp"
|
RelativePath="..\hch\CSndHandler.cpp"
|
||||||
>
|
>
|
||||||
@@ -515,10 +511,6 @@
|
|||||||
RelativePath="..\hch\CPreGameTextHandler.h"
|
RelativePath="..\hch\CPreGameTextHandler.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\CScreenHandler.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\hch\CSndHandler.h"
|
RelativePath="..\hch\CSndHandler.h"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ void CGameHandler::run()
|
|||||||
newTurn();
|
newTurn();
|
||||||
for(std::map<ui8,PlayerState>::iterator i = gs->players.begin(); i != gs->players.end(); i++)
|
for(std::map<ui8,PlayerState>::iterator i = gs->players.begin(); i != gs->players.end(); i++)
|
||||||
{
|
{
|
||||||
if((i->second.towns.size()==0 && i->second.heroes.size()==0) || i->second.color<0) continue; //players has not towns/castle - loser
|
if((i->second.towns.size()==0 && i->second.heroes.size()==0) || i->second.color<0 || i->first>=PLAYER_LIMIT ) continue; //players has not towns/castle - loser
|
||||||
makingTurn = true;
|
makingTurn = true;
|
||||||
gs->currentPlayer = i->first;
|
gs->currentPlayer = i->first;
|
||||||
*connections[i->first] << ui16(100) << i->first;
|
*connections[i->first] << ui16(100) << i->first;
|
||||||
|
|||||||
Reference in New Issue
Block a user