Changeset 6815 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jan 28, 2006, 5:11:51 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 12 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r6780 r6815 1077 1077 SYNCHELP_READ_BEGIN(); 1078 1078 1079 SYNCHELP_READ_FKT( BaseObject::writeState );1079 SYNCHELP_READ_FKT( BaseObject::writeState, NWT_PN_BO_WRITESTATE ); 1080 1080 1081 1081 // char * parentName = NULL; … … 1094 1094 1095 1095 int parentMode; 1096 SYNCHELP_READ_INT( parentMode );1096 SYNCHELP_READ_INT( parentMode, NWT_PN_PARENTMODE ); 1097 1097 this->setParentMode((PARENT_MODE)parentMode); 1098 1098 1099 1099 float f1, f2, f3, f4; 1100 1100 1101 SYNCHELP_READ_FLOAT( f1 );1102 SYNCHELP_READ_FLOAT( f2 );1103 SYNCHELP_READ_FLOAT( f3 );1101 SYNCHELP_READ_FLOAT( f1, NWT_PN_COORX ); 1102 SYNCHELP_READ_FLOAT( f2, NWT_PN_COORY ); 1103 SYNCHELP_READ_FLOAT( f3, NWT_PN_COORZ ); 1104 1104 this->setRelCoor( f1, f2, f3 ); 1105 1105 1106 1106 1107 SYNCHELP_READ_FLOAT( f1 );1108 SYNCHELP_READ_FLOAT( f2 );1109 SYNCHELP_READ_FLOAT( f3 );1110 SYNCHELP_READ_FLOAT( f4 );1107 SYNCHELP_READ_FLOAT( f1, NWT_PN_ROTV ); 1108 SYNCHELP_READ_FLOAT( f2, NWT_PN_ROTX ); 1109 SYNCHELP_READ_FLOAT( f3, NWT_PN_ROTY ); 1110 SYNCHELP_READ_FLOAT( f4, NWT_PN_ROTZ ); 1111 1111 this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) ); 1112 1112 … … 1140 1140 SYNCHELP_WRITE_BEGIN(); 1141 1141 1142 SYNCHELP_WRITE_FKT( BaseObject::readState );1142 SYNCHELP_WRITE_FKT( BaseObject::readState, NWT_PN_BO_WRITESTATE ); 1143 1143 1144 1144 // if ( this->parent ) … … 1151 1151 // } 1152 1152 1153 SYNCHELP_WRITE_INT( this->parentMode );1154 1155 SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );1156 SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );1157 SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );1158 1159 SYNCHELP_WRITE_FLOAT( this->relDirection.w );1160 SYNCHELP_WRITE_FLOAT( this->relDirection.v.x );1161 SYNCHELP_WRITE_FLOAT( this->relDirection.v.y );1162 SYNCHELP_WRITE_FLOAT( this->relDirection.v.z );1153 SYNCHELP_WRITE_INT( this->parentMode, NWT_PN_PARENTMODE ); 1154 1155 SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_COORX ); 1156 SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_COORY ); 1157 SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_COORZ ); 1158 1159 SYNCHELP_WRITE_FLOAT( this->relDirection.w, NWT_PN_ROTV ); 1160 SYNCHELP_WRITE_FLOAT( this->relDirection.v.x, NWT_PN_ROTX ); 1161 SYNCHELP_WRITE_FLOAT( this->relDirection.v.y, NWT_PN_ROTY ); 1162 SYNCHELP_WRITE_FLOAT( this->relDirection.v.z, NWT_PN_ROTZ ); 1163 1163 1164 1164 // int n = children.size(); … … 1209 1209 1210 1210 byte flags = 0; 1211 SYNCHELP_READ_BYTE( flags );1211 SYNCHELP_READ_BYTE( flags, NWT_PN_FLAGS ); 1212 1212 //PRINTF(0)("%s::FLAGS = %d\n", this->getName(), flags); 1213 1213 … … 1216 1216 if ( flags & __FLAG_COOR ) 1217 1217 { 1218 SYNCHELP_READ_FLOAT( f1 );1219 SYNCHELP_READ_FLOAT( f2 );1220 SYNCHELP_READ_FLOAT( f3 );1218 SYNCHELP_READ_FLOAT( f1, NWT_PN_SCOORX ); 1219 SYNCHELP_READ_FLOAT( f2, NWT_PN_SCOORY ); 1220 SYNCHELP_READ_FLOAT( f3, NWT_PN_SCOORZ ); 1221 1221 PRINTF(0)("RCVD COOR: %f %f %f\n", f1, f2, f3); 1222 1222 this->setRelCoor( f1, f2, f3 ); … … 1225 1225 if ( flags & __FLAG_ROT ) 1226 1226 { 1227 SYNCHELP_READ_FLOAT( f1 );1228 SYNCHELP_READ_FLOAT( f2 );1229 SYNCHELP_READ_FLOAT( f3 );1230 SYNCHELP_READ_FLOAT( f4 );1227 SYNCHELP_READ_FLOAT( f1, NWT_PN_SROTV ); 1228 SYNCHELP_READ_FLOAT( f2, NWT_PN_SROTX ); 1229 SYNCHELP_READ_FLOAT( f3, NWT_PN_SROTY ); 1230 SYNCHELP_READ_FLOAT( f4, NWT_PN_SROTZ ); 1231 1231 PRINTF(0)("RCVD QUAT: %f %f %f %f\n", f1, f2, f3, f4); 1232 1232 //this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) ); … … 1250 1250 int PNode::readSync( byte * data, int maxLength ) 1251 1251 { 1252 //WARNING: if you change this file make sure you also change needsReadSync 1252 1253 SYNCHELP_WRITE_BEGIN(); 1253 1254 … … 1270 1271 1271 1272 1272 SYNCHELP_WRITE_BYTE( flags );1273 SYNCHELP_WRITE_BYTE( flags, NWT_PN_FLAGS ); 1273 1274 //PRINTF(0)("FLAGS = %d\n", flags); 1274 1275 … … 1276 1277 { 1277 1278 1278 PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);1279 1280 SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );1281 SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );1282 SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );1279 //PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z); 1280 1281 SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX ); 1282 SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_SCOORY ); 1283 SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_SCOORZ ); 1283 1284 1284 1285 coorx = relCoordinate.x; … … 1290 1291 { 1291 1292 1292 PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);1293 1294 SYNCHELP_WRITE_FLOAT( this->absDirection.w );1295 SYNCHELP_WRITE_FLOAT( this->absDirection.v.x );1296 SYNCHELP_WRITE_FLOAT( this->absDirection.v.y );1297 SYNCHELP_WRITE_FLOAT( this->absDirection.v.z );1293 //PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z); 1294 1295 SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV ); 1296 SYNCHELP_WRITE_FLOAT( this->absDirection.v.x, NWT_PN_SROTX ); 1297 SYNCHELP_WRITE_FLOAT( this->absDirection.v.y, NWT_PN_SROTY ); 1298 SYNCHELP_WRITE_FLOAT( this->absDirection.v.z, NWT_PN_SROTZ ); 1298 1299 1299 1300 rotw = absDirection.w; … … 1305 1306 return SYNCHELP_WRITE_N; 1306 1307 } 1308 1309 bool PNode::needsReadSync( ) 1310 { 1311 if ( fabs( coorx - relCoordinate.x ) > __OFFSET_POS || 1312 fabs( coory - relCoordinate.y ) > __OFFSET_POS || 1313 fabs( coorz - relCoordinate.z ) > __OFFSET_POS ) 1314 return true; 1315 1316 if ( fabs( rotw - absDirection.w ) > __OFFSET_ROT || 1317 fabs( rotx - absDirection.v.x ) > __OFFSET_ROT || 1318 fabs( roty - absDirection.v.y ) > __OFFSET_ROT || 1319 fabs( rotz - absDirection.v.z ) > __OFFSET_ROT ) 1320 return true; 1321 1322 return false; 1323 } -
trunk/src/lib/coord/p_node.h
r6695 r6815 190 190 int writeSync(const byte* data, int length, int sender); 191 191 int readSync(byte* data, int maxLength ); 192 bool needsReadSync(); 192 193 193 194 private: -
trunk/src/lib/graphics/Makefile.am
r6753 r6815 9 9 render2D/render_2d.cc \ 10 10 render2D/element_2d.cc \ 11 render2D/billboard.cc \ 11 12 text_engine/text_engine.cc \ 12 13 text_engine/text.cc \ 13 14 text_engine/font.cc \ 14 15 effects/graphics_effect.cc \ 15 effects/fog_effect.cc 16 effects/fog_effect.cc \ 17 effects/lense_flare.cc 18 16 19 17 20 noinst_HEADERS = graphics_engine.h \ … … 20 23 render2D/render_2d.h \ 21 24 render2D/element_2d.h \ 25 render2D/billboard.h \ 22 26 text_engine/text_engine.h \ 23 27 text_engine/text.h \ 24 28 text_engine/font.h \ 25 29 effects/graphics_effect.h \ 26 effects/fog_effect.h 30 effects/fog_effect.h \ 31 effects/lense_flare.h 27 32 28 33 -
trunk/src/lib/graphics/effects/fog_effect.cc
r6772 r6815 62 62 void FogEffect::loadParams(const TiXmlElement* root) 63 63 { 64 printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.loadParms\n\n"); 64 65 GraphicsEffect::loadParams(root); 65 66 66 LoadParam(root, "fog- effect", this, FogEffect, setFogMode)67 LoadParam(root, "fog-mode", this, FogEffect, setFogMode) 67 68 .describe("sets the the fog mode {GL_LINEAR, GL_EXP, GL_EXP2}"); 68 69 … … 87 88 bool FogEffect::activate() 88 89 { 90 printf("fog==============================================>>>>>>>>>>>>>>>>>>>>>>>>...\n\n"); 89 91 PRINTF(4)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f\n", this->fogMode, this->fogDensity, 90 92 this->fogStart, this->fogEnd); … … 92 94 glEnable(GL_FOG); 93 95 { 94 GLfloat fogColor[4] = {0. 5, 0.5, 0.5, 1.0};96 GLfloat fogColor[4] = {0.6, 0.6, 0.6, 1.0}; 95 97 96 98 glFogi(GL_FOG_MODE, this->fogMode); -
trunk/src/lib/graphics/effects/graphics_effect.cc
r6772 r6815 72 72 bool GraphicsEffect::init() 73 73 {} 74 75 76 77 /** 78 * draws the effect, if needed 79 */ 80 void GraphicsEffect::draw() const 81 {} 82 83 84 85 /** 86 * ticks the effect if there is any time dependancy 87 */ 88 void GraphicsEffect::tick(float dt) 89 {} -
trunk/src/lib/graphics/effects/graphics_effect.h
r6772 r6815 25 25 virtual bool deactivate() = 0; 26 26 27 inline bool isActivated() { return this->bActivated; } 27 virtual void draw() const; 28 virtual void tick(float dt); 29 30 inline bool isActivated() const { return this->bActivated; } 28 31 29 32 -
trunk/src/lib/graphics/graphics_engine.cc
r6780 r6815 41 41 #include "shell_command.h" 42 42 43 44 #include "parser/tinyxml/tinyxml.h" 45 #include "load_param.h" 46 #include "factory.h" 47 43 48 #ifdef __WIN32__ 44 49 #include "class_list.h" … … 113 118 GraphicsEngine::singletonRef = NULL; 114 119 } 120 121 122 /** 123 * loads the GraphicsEngine Specific Parameters. 124 * @param root: the XML-Element to load the Data From 125 */ 126 void GraphicsEngine::loadParams(const TiXmlElement* root) 127 { 128 LoadParamXML(root, "load-effect", this, GraphicsEngine, loadGraphicsEffectXML) 129 .describe("loads a graphics effect"); 130 } 131 115 132 116 133 /** … … 150 167 this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 151 168 152 GraphicsEffect* fe = new FogEffect(NULL);153 this->loadGraphicsEffect(fe);154 fe->activate();155 PRINTF(0)("--------------------------------------------------------------\n");169 // GraphicsEffect* fe = new FogEffect(NULL); 170 // this->loadGraphicsEffect(fe); 171 // fe->activate(); 172 // PRINTF(0)("--------------------------------------------------------------\n"); 156 173 } 157 174 … … 571 588 #endif /* NO_TEXT */ 572 589 573 574 } 590 } 591 575 592 Render2D::getInstance()->tick(dt); 593 594 // tick the graphics effects 595 list<GraphicsEffect*>::iterator it; 596 for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++) 597 (*it)->tick(dt); 576 598 } 577 599 … … 587 609 Render2D::getInstance()->draw(E2D_LAYER_ALL); 588 610 Shader::restoreShader(); 611 612 //draw the graphics 613 list<GraphicsEffect*>::const_iterator it; 614 for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++) 615 (*it)->draw(); 589 616 } 590 617 … … 661 688 662 689 /** 690 * @param root The XML-element to load GraphicsEffects from 691 */ 692 void GraphicsEngine::loadGraphicsEffectXML(const TiXmlElement* root) 693 { 694 const TiXmlElement* element = root->FirstChildElement(); 695 696 while (element != NULL) 697 { 698 Factory::fabricate(element); 699 700 element = element->NextSiblingElement(); 701 } 702 } 703 704 705 /** 663 706 * loads a GraphicsEffect into the engine 664 707 * @param effect the GraphicsEffect to add -
trunk/src/lib/graphics/graphics_engine.h
r6753 r6815 23 23 class WorldEntity; 24 24 class GraphicsEffect; 25 class TiXmlElement; 25 26 26 27 //! class to handle graphics … … 34 35 /** @returns a Pointer to the only object of this Class */ 35 36 inline static GraphicsEngine* getInstance() { if (!GraphicsEngine::singletonRef) GraphicsEngine::singletonRef = new GraphicsEngine(); return GraphicsEngine::singletonRef; }; 37 38 virtual void loadParams(const TiXmlElement* root); 36 39 37 40 int init(); … … 83 86 void process(const Event &event); 84 87 88 void loadGraphicsEffectXML(const TiXmlElement* root); 85 89 bool loadGraphicsEffect(GraphicsEffect* effect); 86 90 bool unloadGraphicsEffect(GraphicsEffect* effect); -
trunk/src/lib/lang/base_object.cc
r6640 r6815 204 204 objectName = NULL; 205 205 } 206 SYNCHELP_READ_STRINGM( this->objectName );206 SYNCHELP_READ_STRINGM( this->objectName, NWT_BO_NAME ); 207 207 if ( this->objectName && !strcmp(this->objectName, "") ) 208 208 { … … 225 225 226 226 //PRINTF(0)("objectname = %s\n", this->objectName); 227 SYNCHELP_WRITE_STRING( this->objectName );227 SYNCHELP_WRITE_STRING( this->objectName, NWT_BO_NAME ); 228 228 229 229 return SYNCHELP_WRITE_N; -
trunk/src/lib/network/handshake.cc
r6753 r6815 95 95 if ( !isServer() && hasState( HS_RECVD_VER ) && !hasState( HS_RECVD_HID ) ) 96 96 { 97 if ( length != INTSIZE+INTSIZE )98 { 99 PRINTF(0)("hostID packet has wrong size %d instead of %d\n", length, 1);100 setState( HS_COMPLETED ); 101 return 0; 102 }97 /*if ( length != INTSIZE+INTSIZE ) 98 { 99 PRINTF(0)("hostID packet has wrong size %d instead of %d\n", length, INTSIZE+INTSIZE); 100 setState( HS_COMPLETED ); 101 return 0; 102 }*/ 103 103 104 104 setState( HS_COMPLETED ); 105 105 setState( HS_RECVD_HID ); 106 106 this->isOk = true; 107 SYNCHELP_READ_INT( this->newHostId );108 SYNCHELP_READ_INT( this->newNetworkGameManagerId );107 SYNCHELP_READ_INT( this->newHostId, NWT_HS_HOST_ID ); 108 SYNCHELP_READ_INT( this->newNetworkGameManagerId, NWT_HS_NGM_ID ); 109 109 110 110 if ( newHostId == 0 ) … … 180 180 isOk = false; 181 181 //memcpy(data, (byte*)0, 4); 182 SYNCHELP_WRITE_INT( 0 183 SYNCHELP_WRITE_INT( 0 182 SYNCHELP_WRITE_INT( 0, NWT_HS_HOST_ID); 183 SYNCHELP_WRITE_INT( 0, NWT_HS_NGM_ID); 184 184 } 185 185 else … … 187 187 isOk = true; 188 188 //memcpy(data, &clientId, 4); 189 SYNCHELP_WRITE_INT( clientId );190 SYNCHELP_WRITE_INT( networkGameManagerId );189 SYNCHELP_WRITE_INT( clientId, NWT_HS_HOST_ID ); 190 SYNCHELP_WRITE_INT( networkGameManagerId, NWT_HS_NGM_ID ); 191 191 } 192 192 *reciever = clientId; -
trunk/src/lib/network/network_game_manager.cc
r6737 r6815 167 167 if ( !isServer() && !hasRequestedWorld ) 168 168 { 169 SYNCHELP_WRITE_BEGIN(); 170 byte b = NET_REQUEST_ENTITY_LIST; 171 SYNCHELP_WRITE_BYTE( b ); 169 assert( maxLength >= 1 ); 170 data[0] = NET_REQUEST_ENTITY_LIST; 172 171 hasRequestedWorld = true; 173 return SYNCHELP_WRITE_N;172 return 1; 174 173 } 175 174 -
trunk/src/lib/network/synchronizeable.h
r6753 r6815 20 20 #define STATE_OUTOFSYNC 2 21 21 #define STATE_REQUESTEDSYNC 4 22 23 enum { 24 NWT_SS_WE_STATE = 1000000, 25 NWT_SS_B, 26 NWT_SS_FLAGS, 27 NWT_SS_MOUSEDIRX, 28 NWT_SS_MOUSEDIRY, 29 NWT_SS_MOUSEDIRZ, 30 NWT_SS_MOUSEDIRW, 31 NWT_SS_PN_SYNC, 32 NWT_SS_VELX, 33 NWT_SS_VELY, 34 NWT_SS_VELZ, 35 36 NWT_HS_HOST_ID, 37 NWT_HS_NGM_ID, 38 39 NWT_PN_BO_WRITESTATE, 40 NWT_PN_PARENTMODE, 41 NWT_PN_COORX, 42 NWT_PN_COORY, 43 NWT_PN_COORZ, 44 NWT_PN_ROTX, 45 NWT_PN_ROTY, 46 NWT_PN_ROTZ, 47 NWT_PN_ROTV, 48 49 NWT_PN_FLAGS, 50 NWT_PN_SCOORX, 51 NWT_PN_SCOORY, 52 NWT_PN_SCOORZ, 53 NWT_PN_SROTX, 54 NWT_PN_SROTY, 55 NWT_PN_SROTZ, 56 NWT_PN_SROTV, 57 58 NWT_BO_NAME, 59 60 NWT_WE_PN_WRITESTATE, 61 NWT_WE_PN_MODELFILENAME, 62 NWT_WE_PN_SCALING, 63 64 NWT_GT_WE_STATE, 65 66 NWT_SB_WE_STATE, 67 NWT_SB_SIZE, 68 NWT_SB_TEXTURENAME, 69 70 NWT_TER_WE_STATE, 71 72 NWT_PU_WE_STATE, 73 74 NWT_TPU_WE_STATE, 75 76 NWT_LPU_WE_STATE, 77 78 NWT_WPU_WE_STATE, 79 80 NWT_PPU_WE_STATE, 81 NWT_PPU_TYPE, 82 NWT_PPU_VALUE, 83 NWT_PPU_MINVALUE, 84 NWT_PPU_MAXVALUE, 85 86 NWT_WAT_STATE, 87 NWT_WAT_WE_STATE, 88 NWT_WAT_SIZEX, 89 NWT_WAT_SIZEY, 90 NWT_WAT_RESX, 91 NWT_WAT_RESY, 92 NWT_WAT_HEIGHT 93 }; 22 94 23 95 … … 58 130 * 59 131 */ 132 #define SYNCHELP_WRITE_DEBUG(n) {\ 133 __synchelp_write_n = Converter::intToByteArray( n, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ 134 assert( __synchelp_write_n == INTSIZE ); \ 135 __synchelp_write_i += __synchelp_write_n; \ 136 } 137 138 #define SYNCHELP_READ_DEBUG(n) { \ 139 int nn; \ 140 __synchelp_read_n = Converter::byteArrayToInt( data+__synchelp_read_i, &nn ); \ 141 assert( __synchelp_read_n == INTSIZE ); \ 142 if ( n != nn ) { \ 143 PRINTF(1)("Check your code! read/writes not in right order! read %d instead of %d\n", nn, n); \ 144 assert( false ); \ 145 } \ 146 __synchelp_read_i += __synchelp_read_n; \ 147 } 148 60 149 #define SYNCHELP_WRITE_BEGIN() int __synchelp_write_i = 0; \ 61 150 int __synchelp_write_n 62 #define SYNCHELP_WRITE_INT(i) { __synchelp_write_n = \ 151 #define SYNCHELP_WRITE_INT(i,n) { SYNCHELP_WRITE_DEBUG(n); \ 152 __synchelp_write_n = \ 63 153 Converter::intToByteArray( i, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ 64 154 assert( __synchelp_write_n == INTSIZE ); \ … … 70 160 __synchelp_write_i += __synchelp_write_n; \ 71 161 } 72 #define SYNCHELP_WRITE_FLOAT(f) { __synchelp_write_n = \ 162 #define SYNCHELP_WRITE_FLOAT(f,n) { SYNCHELP_WRITE_DEBUG(n); \ 163 __synchelp_write_n = \ 73 164 Converter::floatToByteArray( f, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ 74 165 assert( __synchelp_write_n == FLOATSIZE ); \ … … 80 171 __synchelp_write_i += __synchelp_write_n; \ 81 172 } 82 #define SYNCHELP_WRITE_BYTE(b) { \ 173 #define SYNCHELP_WRITE_BYTE(b,n) { SYNCHELP_WRITE_DEBUG(n); \ 174 \ 83 175 if (maxLength - __synchelp_write_i < 1) \ 84 176 { \ … … 89 181 __synchelp_write_i++; \ 90 182 } 91 #define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) {\ 183 #define SYNCHELP_WRITE_STRING(s,n) { SYNCHELP_WRITE_DEBUG(n); \ 184 if (s!=NULL) {\ 92 185 __synchelp_write_n = \ 93 186 Converter::stringToByteArray( s, data+__synchelp_write_i, strlen(s), maxLength-__synchelp_write_i ); \ … … 105 198 } 106 199 #define SYNCHELP_WRITE_N __synchelp_write_i 107 #define SYNCHELP_WRITE_FKT(f ) {\200 #define SYNCHELP_WRITE_FKT(f,n) { SYNCHELP_WRITE_DEBUG(n); \ 108 201 __synchelp_write_i += \ 109 202 f( data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ … … 114 207 int __synchelp_read_n 115 208 116 #define SYNCHELP_READ_INT(i ) {\209 #define SYNCHELP_READ_INT(i,n) { SYNCHELP_READ_DEBUG(n); \ 117 210 if ( length-__synchelp_read_i < INTSIZE ) \ 118 211 { \ … … 124 217 __synchelp_read_i += __synchelp_read_n; \ 125 218 } 126 #define SYNCHELP_READ_FLOAT(f ) {\219 #define SYNCHELP_READ_FLOAT(f,n) { SYNCHELP_READ_DEBUG(n); \ 127 220 if ( length-__synchelp_read_i < FLOATSIZE ) \ 128 221 { \ … … 134 227 __synchelp_read_i += __synchelp_read_n; \ 135 228 } 136 #define SYNCHELP_READ_STRING(s,l ) {\229 #define SYNCHELP_READ_STRING(s,l,n) {SYNCHELP_READ_DEBUG(n); \ 137 230 __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, l ); \ 138 231 assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\ … … 144 237 __synchelp_read_i += __synchelp_read_n; \ 145 238 } 146 #define SYNCHELP_READ_STRINGM(s ) {\239 #define SYNCHELP_READ_STRINGM(s,n) { SYNCHELP_READ_DEBUG(n); \ 147 240 __synchelp_read_n = Converter::byteArrayToStringM( data+__synchelp_read_i, s ); \ 148 241 assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\ … … 154 247 __synchelp_read_i += __synchelp_read_n; \ 155 248 } 156 #define SYNCHELP_READ_BYTE(b ) {\249 #define SYNCHELP_READ_BYTE(b,n) { SYNCHELP_READ_DEBUG(n); \ 157 250 if ( length-__synchelp_read_i < 1 ) \ 158 251 { \ … … 163 256 __synchelp_read_i ++; \ 164 257 } 165 #define SYNCHELP_READ_FKT(f ) {\258 #define SYNCHELP_READ_FKT(f,n) { SYNCHELP_READ_DEBUG(n); \ 166 259 __synchelp_read_i += \ 167 260 f( data+__synchelp_read_i, length-__synchelp_read_i, sender); \ 168 261 } 262 #define SYNCHELP_READ_REMAINING() ( length-__synchelp_read_i ) 263 #define SYNCHELP_READ_NEXTBYTE() ( data[__synchelp_read_i] ) 169 264 #define SYNCHELP_READ_N __synchelp_read_i 170 265
Note: See TracChangeset
for help on using the changeset viewer.