MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / java_nextTextPart

Function java_nextTextPart

src/LBackend_Android.c:157–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157static jstring JNICALL java_nextTextPart(JNIEnv* env, jobject o, jstring total, jintArray state) {
158 char buffer[NATIVE_STR_LEN];
159 // TODO should it really be raw?
160 cc_string text = Java_DecodeRaw(env, total, buffer);
161
162 jint* state_ = (*env)->GetIntArrayElements(env, state, NULL);
163 text.buffer += state_[0];
164 text.length -= state_[0];
165
166 cc_string left = text, part;
167 char colorCode = 'f';
168
169 Drawer2D_UNSAFE_NextPart(&text, &part, &colorCode);
170 BitmapCol color = Drawer2D_GetColor(colorCode);
171
172 state_[0] += left.length - text.length;
173 state_[1] = ToAndroidColor(color);
174
175 (*env)->ReleaseIntArrayElements(env, state, state_, 0);
176 return Java_AllocString(env, &part);
177}
178
179
180/*########################################################################################################################*

Callers

nothing calls this directly

Calls 3

Drawer2D_UNSAFE_NextPartFunction · 0.85
ToAndroidColorFunction · 0.85
Java_AllocStringFunction · 0.85

Tested by

no test coverage detected