]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_execprogram.h
experimental makefile option make DP_LINK_TO_JPEG=1 - use libjpeg.h instead of dynami...
[xonotic/darkplaces.git] / prvm_execprogram.h
index 10549bcfc33d6a01bc7c6a4f1e68c55ce10136be..17ea2fccca4b341d4789c05840f0275938c9b0ce 100644 (file)
                                }
 #endif
                                ptr = (prvm_eval_t *)((unsigned char *)prog->edictsfields + OPB->_int);
-                               ptr->vector[0] = OPA->vector[0];
-                               ptr->vector[1] = OPA->vector[1];
-                               ptr->vector[2] = OPA->vector[2];
+                               ptr->ivector[0] = OPA->ivector[0];
+                               ptr->ivector[1] = OPA->ivector[1];
+                               ptr->ivector[2] = OPA->ivector[2];
                                break;
 
                        case OP_ADDRESS:
                                }
 #endif
                                ed = PRVM_PROG_TO_EDICT(OPA->edict);
-                               OPC->vector[0] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->vector[0];
-                               OPC->vector[1] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->vector[1];
-                               OPC->vector[2] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->vector[2];
+                               OPC->ivector[0] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->ivector[0];
+                               OPC->ivector[1] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->ivector[1];
+                               OPC->ivector[2] = ((prvm_eval_t *)((int *)ed->fields.vp + OPB->_int))->ivector[2];
                                break;
 
                //==================
                                        prog->xfunction->profile += (st - startst);
                                        st += st->b - 1;        // offset the s++
                                        startst = st;
+#if PRVMRUNAWAYCHECK
                                        if (++jumpcount == 10000000)
                                        {
                                                prog->xstatement = st - prog->statements;
                                                PRVM_Profile(1<<30, 1000000);
                                                PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
                                        }
+#endif
                                }
                                break;
 
                                        prog->xfunction->profile += (st - startst);
                                        st += st->b - 1;        // offset the s++
                                        startst = st;
+#if PRVMRUNAWAYCHECK
                                        if (++jumpcount == 10000000)
                                        {
                                                prog->xstatement = st - prog->statements;
                                                PRVM_Profile(1<<30, 1000000);
                                                PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
                                        }
+#endif
                                }
                                break;
 
                                prog->xfunction->profile += (st - startst);
                                st += st->a - 1;        // offset the s++
                                startst = st;
+#if PRVMRUNAWAYCHECK
                                if (++jumpcount == 10000000)
                                {
                                        prog->xstatement = st - prog->statements;
                                        PRVM_Profile(1<<30, 1000000);
                                        PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
                                }
+#endif
                                break;
 
                        case OP_CALL0:
                                        if (builtinnumber < prog->numbuiltins && prog->builtins[builtinnumber])
                                                prog->builtins[builtinnumber]();
                                        else
-                                               PRVM_ERROR("No such builtin #%i in %s", builtinnumber, PRVM_NAME);
+                                               PRVM_ERROR("No such builtin #%i in %s; most likely cause: outdated engine build. Try updating!", builtinnumber, PRVM_NAME);
                                }
                                else
                                        st = prog->statements + PRVM_EnterFunction(newf);
                        case OP_STATE:
                                if(prog->flag & PRVM_OP_STATE)
                                {
-                                       ed = PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
-                                       PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.nextthink)->_float = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.time)->_float + 0.1;
-                                       PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.frame)->_float = OPA->_float;
-                                       PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.think)->function = OPB->function;
+                                       ed = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+                                       PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.nextthink)->_float = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float + 0.1;
+                                       PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.frame)->_float = OPA->_float;
+                                       PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.think)->function = OPB->function;
                                }
                                else
                                {
                                        goto cleanup;
                                }
 #endif
-                               pr_globals[OPB->_int] = OPA->_float;
+                               pr_iglobals[OPB->_int] = OPA->_int;
                                break;
                        case OP_GSTOREP_V:
 #if PRBOUNDSCHECK
                                        goto cleanup;
                                }
 #endif
-                               pr_globals[OPB->_int  ] = OPA->vector[0];
-                               pr_globals[OPB->_int+1] = OPA->vector[1];
-                               pr_globals[OPB->_int+2] = OPA->vector[2];
+                               pr_iglobals[OPB->_int  ] = OPA->ivector[0];
+                               pr_iglobals[OPB->_int+1] = OPA->ivector[1];
+                               pr_iglobals[OPB->_int+2] = OPA->ivector[2];
                                break;
 
                        case OP_GADDRESS:
                                        goto cleanup;
                                }
 #endif
-                               OPC->_float = pr_globals[i];
+                               OPC->_int = pr_iglobals[i];
                                break;
 
                        case OP_GLOAD_I:
                                        goto cleanup;
                                }
 #endif
-                               OPC->_float = pr_globals[OPA->_int];
+                               OPC->_int = pr_iglobals[OPA->_int];
                                break;
 
                        case OP_GLOAD_V:
                                        goto cleanup;
                                }
 #endif
-                               OPC->vector[0] = pr_globals[OPA->_int  ];
-                               OPC->vector[1] = pr_globals[OPA->_int+1];
-                               OPC->vector[2] = pr_globals[OPA->_int+2];
+                               OPC->ivector[0] = pr_iglobals[OPA->_int  ];
+                               OPC->ivector[1] = pr_iglobals[OPA->_int+1];
+                               OPC->ivector[2] = pr_iglobals[OPA->_int+2];
                                break;
 
                        case OP_BOUNDCHECK: