Changeset 4c202e0 in network-game for client


Ignore:
Timestamp:
Dec 25, 2012, 6:59:58 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
3b8adee
Parents:
edfd1d0
Message:

Added Player to the visual studio project, changed Common to use the #defines in Compiler.h, and added basic client support for processing MSG_TYPE_PLAYER messages

Location:
client/Client
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • client/Client/Client.vcxproj

    redfd1d0 r4c202e0  
    6464  </ItemDefinitionGroup>
    6565  <ItemGroup>
     66    <ClCompile Include="..\..\common\Common.cpp" />
    6667    <ClCompile Include="..\..\common\Message.cpp" />
     68    <ClCompile Include="..\..\common\Player.cpp" />
    6769    <ClCompile Include="chat.cpp" />
    6870    <ClCompile Include="Button.cpp" />
     
    7678    <ClInclude Include="..\..\common\Compiler.h" />
    7779    <ClInclude Include="..\..\common\Message.h" />
     80    <ClInclude Include="..\..\common\Player.h" />
    7881    <ClInclude Include="chat.h" />
    7982    <ClInclude Include="Button.h" />
  • client/Client/Client.vcxproj.filters

    redfd1d0 r4c202e0  
    4949      <Filter>Source Files\gui</Filter>
    5050    </ClCompile>
     51    <ClCompile Include="..\..\common\Common.cpp">
     52      <Filter>Source Files\common</Filter>
     53    </ClCompile>
     54    <ClCompile Include="..\..\common\Player.cpp">
     55      <Filter>Source Files\common</Filter>
     56    </ClCompile>
    5157  </ItemGroup>
    5258  <ItemGroup>
     
    7581      <Filter>Header Files\gui</Filter>
    7682    </ClInclude>
     83    <ClInclude Include="..\..\common\Player.h">
     84      <Filter>Header Files\common</Filter>
     85    </ClInclude>
    7786  </ItemGroup>
    7887  <ItemGroup>
  • client/Client/chat.cpp

    redfd1d0 r4c202e0  
    1818void chat::draw(ALLEGRO_FONT *font, ALLEGRO_COLOR color)
    1919{
    20    for(int x=0; x<vctChat.size(); x++)
     20   for(unsigned int x=0; x<vctChat.size(); x++)
    2121      al_draw_text(font, color, 10, 140+x*15, ALLEGRO_ALIGN_LEFT, vctChat[x].c_str());
    2222
  • client/Client/main.cpp

    redfd1d0 r4c202e0  
     1#include "../../common/Compiler.h"
     2
    13#if defined WINDOWS
    24   #include <winsock2.h>
     
    2123#include <allegro5/allegro_ttf.h>
    2224
    23 #include "../../common/Compiler.h"
    2425#include "../../common/Message.h"
    2526#include "../../common/Common.h"
     27#include "../../common/Player.h"
    2628
    2729#include "Window.h"
     
    433435               break;
    434436            }
     437            case MSG_TYPE_PLAYER:
     438            {
     439               Player p = *(Player*)(&(msg.buffer));
     440
     441               cout << "p.name: " << p.name;
     442               cout << "p.pos.x: " << p.pos.x;
     443               cout << "p.pos.y: " << p.pos.y;
     444
     445               break;
     446            }
    435447         }
    436448                     
Note: See TracChangeset for help on using the changeset viewer.